Re: [OSM-dev] osm2psql .style file parameters/values

2012-07-10 Thread Frederik Ramm

Hi,

On 07/10/12 03:54, mick wrote:

What other values can be used in each column? I would like to use a
logical data type for items like bridge, tunnel, oneway, ... and
small int for maxspeed, lanes, layers, ...


If you want a ready-made software that gives you more control over the 
database structure than osm2pgsql offers, I suggest you have a look at 
imposm (Python). If you want a solid programmer's framework for your own 
OSM parsing and processing, I suggest you use osmium (C++).



Another useful feature would be to scan the .osm file for all tags
used and the other tags they are used with.


taginfo.openstreetmap.org does that on a world-wide basis but the 
software is available for installing locally so you could run taginfo 
for your area of interest only.



I am in the very early stages of a C program (using GTK for the gui)
with the eventual goal of allowing output as database input or
conversion to GIS formats. I'm stuck with some of the interface code
ATM.


You'll probably get stuck with other things later - it is not as easy as 
one might think; you'll want pbf support, proper multipolygon handling, 
and other things that cost time to implement. The aforementioned 
software takes some of that burden away.


Bye
Frederik

--
Frederik Ramm  ##  eMail frede...@remote.org  ##  N49°00'09 E008°23'33



___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2psql .style file parameters/values

2012-07-10 Thread mick
On Tue, 10 Jul 2012 08:48:38 +0200
Frederik Ramm frede...@remote.org wrote:

 Hi,
 
 On 07/10/12 03:54, mick wrote:
  What other values can be used in each column? I would like to use a
  logical data type for items like bridge, tunnel, oneway, ... and
  small int for maxspeed, lanes, layers, ...
 
 If you want a ready-made software that gives you more control over the 
 database structure than osm2pgsql offers, I suggest you have a look at 
 imposm (Python). If you want a solid programmer's framework for your own 
 OSM parsing and processing, I suggest you use osmium (C++).

osm2pgsql does a decent job as far as _I_ can use it, the style file looks to 
me like it should be able to refine things more with different data types, eg. 
boolean, short int, int, long int, float,...

Unfortunately I am unable to twist my mind around object-oriented type syntax 
but have an almost working knowledge of C, with help from snippets and other 
examples to hack at. GTK I find a challenge since the removed the C code 
generation feature from glade.

Looking at the easy to find descriptions and features of OSM I was starting to 
believe I was the only person trying to manipulate the data in these kinds of 
ways.
 
  Another useful feature would be to scan the .osm file for all tags
  used and the other tags they are used with.
 
 taginfo.openstreetmap.org does that on a world-wide basis but the 
 software is available for installing locally so you could run taginfo 
 for your area of interest only.

I'll give taginfo a closer look later. I have been using 
cat mymap.osm | grep key  taglist to help see what keys have been used in 
order to strip out key=value set I don't need but it doesn't get me all the way
 
  I am in the very early stages of a C program (using GTK for the gui)
  with the eventual goal of allowing output as database input or
  conversion to GIS formats. I'm stuck with some of the interface code
  ATM.
 
 You'll probably get stuck with other things later - it is not as easy as 
 one might think; you'll want pbf support, proper multipolygon handling, 
 and other things that cost time to implement. The aforementioned 
 software takes some of that burden away.

I'm certain to get stuck on many things as time passes. I have no delusions 
about it being any where near easy but if it was easy I wouldn't learn 
anything. 

Thanks Frederik, you have given me useful help.

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2psql .style file parameters/values

2012-07-10 Thread Sven Geggus
mick bare...@tpg.com.au wrote:

 osm2pgsql does a decent job as far as _I_ can use it, the style file looks
 to me like it should be able to refine things more with different data
 types, eg. boolean, short int, int, long int, float,...

No! In osm2pgsql tags are always assumed to be text which is of course what
they actually are. The z_order int4 and and way_area real are calculated
during import so the do not count.

I did however add support for real columns in february in order to be able
to import width and ele tags as floating point values.

This currently involves a lot of hard coded heuristics!

Here is what it do:
* assume , to be a decimal mark which need to be replaced by .
* take the leading number if there is more than one or additional text
* average if it's a-b
* assume values to be in meters thus ignore any unit but feet
* convert feet to meters if ft is given as unit (1 foot = 0.3048 meters)
* reject anything else


Regards


Sven

-- 
Remember, democracy never lasts long. It soon wastes itself,
exhausts and murders itself. There never was a democracy yet
that did not commit suicide. (John Quincy Adams)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


Re: [OSM-dev] osm2psql .style file parameters/values

2012-07-10 Thread mick
On Tue, 10 Jul 2012 12:33:32 + (UTC)
Sven Geggus li...@fuchsschwanzdomain.de wrote:

 mick bare...@tpg.com.au wrote:
 
  osm2pgsql does a decent job as far as _I_ can use it, the style file looks
  to me like it should be able to refine things more with different data
  types, eg. boolean, short int, int, long int, float,...
 
 No! In osm2pgsql tags are always assumed to be text which is of course what
 they actually are. The z_order int4 and and way_area real are calculated
 during import so the do not count.
 
 I did however add support for real columns in february in order to be able
 to import width and ele tags as floating point values.
 
 This currently involves a lot of hard coded heuristics!
 
 Here is what it do:
 * assume , to be a decimal mark which need to be replaced by .
 * take the leading number if there is more than one or additional text
 * average if it's a-b
 * assume values to be in meters thus ignore any unit but feet
 * convert feet to meters if ft is given as unit (1 foot = 0.3048 meters)
 * reject anything else
 
 

No problem, I'm not sure if it matters anyway and I can change it after I 
import the data into mapinfo for editing.

My main reason for wanting to use more specific data types was the possibility 
that I might need to do some processing / analysis at a later stage.

mick

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev


[OSM-dev] osm2psql .style file parameters/values

2012-07-09 Thread mick
My current project requires me to map roads for cars within a large area.

While manually adjusting the data I have found about 40% of objects with 
incomplete tagging with about 5% of tags seeming, to me at least, of dubious 
accuracy.

To make the process easier I have attempted to use osm2pgsql to load the data 
into a database but I'm finding it a bit difficult to get the data organised to 
reduce manual edits.

I've searched, but been unable to find a good description of the use of the 
.style files. The file has the following column headings:-

OsmType Tag DataTypeFlags

OsmType   column contains node or node,way
Tag   column is clear enough
DataType  All examples are text
Flags shows delete, linear or nocache

What other values can be used in each column?
I would like to use a logical data type for items like bridge, tunnel, oneway, 
... and small int for maxspeed, lanes, layers, ...

Is this possible?

Another useful feature would be to scan the .osm file for all tags used and the 
other tags they are used with.

I am in the very early stages of a C program (using GTK for the gui) with the 
eventual goal of allowing output as database input or conversion to GIS 
formats. I'm stuck with some of the interface code ATM.

Once I have the data improved I hope to feed it back into OSM (preferably with 
some peer review as, being human, I can't guarantee 100% accuracy and I don't 
want to flood OSM with new errors.

sparrowhawk

___
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev