[OSM-talk] project

2010-04-11 Thread Torsten Mohr
Hello,

i created a GIS database and imported the planet data with osm2pgsql -m.
So the data is stored in mercaator format.

When executing this raw SQL query:

select st_X(way), st_Y(way), name from planet_osm_point where capital='yes';

Then i get some data like:

   st_x|   st_y|name
---+---+
  -18915583.203791 | -2162182.86527014 | Alofi
 -11035458.4801666 |  2205926.10968281 | Ciudad de México
 -10075876.3988655 |  1648035.49949994 | Guatemala City

How can i reproject the st_x and st_y to latitude / longitude?

I'd like to do this in an own program.  I already reprojected some
Tiff data from latitude / longitude to mercaator, that worked fine.

But i don't know what st_x and st_y actually are, how they are scaled,
what is their offset.  The documentation for st_X and st_Y didn't help
me for this issue.

Can anybody please explain to me what st_x and st_y are, how they are scaled,
what is their offset so i can reproject these data to latitude / longitude?


Thanks for any hints,
Torsten.

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


[OSM-talk] setting up a new PostGIS server, now MapNik doesn't render PostGis data any more

2010-03-31 Thread Torsten Mohr
Hi,

i've set up a new PostGIS server on Linux, i had all tools installed before, 
i've just replaced the old database gis with a new one that i've imported 
using -l instead of -m, so i use lat/lon instead of mercaator.

Now Mapnik still renders GeoTIFF and Shapefiles, but no data that come from 
PostGIS.  But also, normal SQL queries still work.


So i wonder what went wrong?


Where could i search next?


Thanks for any hints,
Torsten.

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


Re: [OSM-talk] setting up a new PostGIS server, n ow MapNik doesn't render PostGis data any more

2010-03-31 Thread Torsten Mohr
Hello,

  Now Mapnik still renders GeoTIFF and Shapefiles, but no data that come
  from PostGIS.  But also, normal SQL queries still work.
 
 What is the setting of
 
 Parameter name=estimate_extent
 Parameter name=extent

Parameter name=estimate_extentfalse/Parameter
Parameter name=extent-20037508,-19929239,20037508,19929239/Parameter

so it is a problem of the settings?  From googling it seems i need to
set extent to -180,-90, 180,89.99 ?


Do i also need to change the SRS?  At the moment it is set to:

+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 
+units=m +nadgri...@null +no_defs +over


In some examples i only see:

+proj=latlong +datum=WGS84


Best regards,
Torsten.

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


Re: [OSM-talk] setting up PostGIS, importing data

2010-03-23 Thread Torsten Mohr
Hello,

thanks for your hints, i've set up the database gis completely new,
now i also imported _int.sql.

  Setting up table: planet_osm_nodes
  *** WARNING: intarray contrib module not installed

Now i get this error during import:

Reading in file: /local/ftp/osm/planet-100310.osm.bz2
Processing: Node(349410k) Way(0k) Relation(0k)Entity: line 529642199: parser 
error : xmlParseCharRef: invalid xmlChar value 24
tag k=name v=#24;#22;Meycauayan City Northbound Entry Point /
  ^
Entity: line 529642199: parser error : xmlParseCharRef: invalid xmlChar value 
22
tag k=name v=#24;#22;Meycauayan City Northbound Entry Point /
   ^
/local/ftp/osm/planet-100310.osm.bz2 : failed to parse
Error occurred, cleaning up


I can't imagine that the file is corrupt.  I do not use mercator projection in 
the database, based on a hint i got here.  I use -l to get lat/lon.
But i also can't imagine that this is the problem.


Here are the commands that i used to set everything up:

su postgres
createuser -Upostgres -S -D -R tmohr
createdb -Upostgres  -EUTF8 gis
psql -Upostgres gis
gis=# GRANT ALL ON SCHEMA PUBLIC TO tmohr;
GRANT
\q
createlang plpgsql gis
psql -d gis -f /usr/share/postgresql/contrib/_int.sql

psql -d gis -f /usr/share/postgresql/contrib/postgis.sql

psql -d gis -f /usr/share/postgresql/contrib/spatial_ref_sys.sql

psql -d gis

GRANT ALL on geometry_columns TO tmohr;

GRANT ALL on spatial_ref_sys TO tmohr;

GRANT ALL ON SCHEMA PUBLIC TO tmohr;


osm2pgsql -s -l /local/ftp/osm/planet-100310.osm.bz2


Did anybody have this bug before?

Does anybody know what's wrong?


Thanks for any hints,
Torsten.

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


Re: [OSM-talk] setting up PostGIS, importing data

2010-03-23 Thread Torsten Mohr
Hello,

  I can't imagine that the file is corrupt.
 
 It is corrupt, from the developer list:
 
  The planet dump code used to turn all characters less than 32
 into '?' instead of creating these character sequences. I guess he
 didn't read the bit of the XML spec which says that all characters 32
 are invalid except for tab / newline / carriage return[1]. It makes no
 difference whether they exist as plain characters or character entities,
 they are still not allowed, e.g.

thanks for that explanation.

 I have a committed a change which should resolve this for future dumps
 in r20430 but someone needs to compile and update the copy on the
 server.
 
 Next planet dump should be OK, or you can read from the dev list about how
  to update problematic characters to something acceptable.

Great, then i'll wait for that next dump and install it.  Hopefully it won't 
take long.  But i guess it won't as obviously this one has some problems.


Best regards,
Torsten.

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


[OSM-talk] setting up PostGIS, importing data

2010-03-22 Thread Torsten Mohr
Hello,

i hope this is not off-topic here.  I've set up a Postgis server here on my 
linux box using OpenSuSE 11.2 like this:

Here are the commands (User tmohr):

su postgres
createuser -Upostgres -S -D -R tmohr
createdb -Upostgres  -EUTF8 gis
psql -Upostgres gis
gis=# GRANT ALL ON SCHEMA PUBLIC TO tmohr;
GRANT

Then quit, \q

createlang plpgsql gis
psql -d gis -f /usr/share/postgresql/contric/postgis.sql

psql -d gis -f /usr/share/postgresql/contric/spatial_ref_sys.sql

psql gis

GRANT ALL on geometry_columns TO tmohr;
GRANT ALL on spatial_ref_sys TO tmohr;
GRANT ALL ON SCHEMA PUBLIC TO tmohr;


osm2pgsql -s -l /local/ftp/planet-100310.osm.bz2

And this last command leads to failures:

Using projection SRS 4326 (Latlong)
Setting up table: planet_osm_point 
HINWEIS:  Tabelle »planet_osm_point« existiert nicht, wird übersprungen
HINWEIS:  Tabelle »planet_osm_point_tmp« existiert nicht, wird übersprungen
Setting up table: planet_osm_line
HINWEIS:  Tabelle »planet_osm_line« existiert nicht, wird übersprungen
HINWEIS:  Tabelle »planet_osm_line_tmp« existiert nicht, wird übersprungen
Setting up table: planet_osm_polygon
HINWEIS:  Tabelle »planet_osm_polygon« existiert nicht, wird übersprungen
HINWEIS:  Tabelle »planet_osm_polygon_tmp« existiert nicht, wird übersprungen
Setting up table: planet_osm_roads
HINWEIS:  Tabelle »planet_osm_roads« existiert nicht, wird übersprungen
HINWEIS:  Tabelle »planet_osm_roads_tmp« existiert nicht, wird übersprungen
Mid: pgsql, scale=1000, cache=800MB, maxblocks=102401*8192
Setting up table: planet_osm_nodes
*** WARNING: intarray contrib module not installed


It seems that the tables planet_osm_point, planet_osm_line and so on do not 
exist.

Did i miss a command to set up these tables?

Which command should have created the tables?  I thought they'd be created by 
executing postgis.sql ?


Thanks for any hints,
Torsten.

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


Re: [OSM-talk] get latitude / longitude of points?

2010-03-16 Thread Torsten Mohr
Hello,

thanks a lot for your hint.

 http://postgis.refractions.net/documentation/manual-svn/ST_X.html
 http://postgis.refractions.net/documentation/manual-svn/ST_Y.html
 
 select st_X(st_transform(way,4326)), st_Y(st_transform(way,4326)) from
 planet_osm_point where ...

I tried it like this:

select st_X(st_transform(way,4326)), st_Y(st_transform(way,4326)) from 
planet_osm_point where name='Berlin' and place='city';

But this lead to this error:

FEHLER:  transform: couldn't project point (1.48918e+06 6.894e+06 0): failed 
to load NAD27-83 correction file (-38)
TIP:  PostGIS was unable to transform the point because either no grid shift 
files were found, or the point does not lie within the range for which the 
grid shift is defined. Refer to the ST_Transform() section of the PostGIS 
manual for details on how to configure PostGIS to alter this behaviour.

So i looked it up in the documentation for st_Transform().  I got:

select PostGIS_Full_Version();
  postgis_full_version

 POSTGIS=1.4.1 GEOS=3.2.0-CAPI-1.6.0 PROJ=Rel. 4.7.1, 23 September 2009 
USE_STATS
(1 Zeile)

So to my understanding, my version of Proj is fine, right?

I then tried to google for that error and got some discussion threads.  But 
none of them seemed to have a really usable solution.


Is there any hint you could give me to solve this problem?


Maybe there's a way around this in mapnik?


Thanks for any hints,
Torsten.

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


Re: [OSM-talk] get latitude / longitude of points?

2010-03-16 Thread Torsten Mohr
Hello,

first, thank you all for your hints.

 You might also consider importing with osm2pqsql with the -l flag (use
 lat/lon) that way your database will be in a EPSG:4326 official
 projection (which 900913 is not) and you will have an easier life if you
 want to convert between projections.
 
 I am also a *fan* of using wgs84 in my postgis database when it comes to
 OSM data under the simple rule of fist that it is in my opinion best to
 keep data in the projection it was created with and for GPS this is
 always wgs84. For my national dutch data derived from official
 government bodies; my rule is store it in EPSG:28992 (the official
 dutch projection) because that is the coordinate-system they survey in.

I think this is the next thing i'll try.  I just downloaded the latest version
of planet_osm and i'll install in WGS84 (if that does not break any other
programs / scripts).  I mainly use mapnik.

It also looks natural to me to install in WGS84 and if that also solves some
problems, that's great.


Best regards,
Torsten.

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


[OSM-talk] get latitude / longitude of points?

2010-03-15 Thread Torsten Mohr
Hi,

i'm not sure what is the best way, Mapnik or plain postgresql, maybe somebody
can give me a hint?

I'd like to get the coordinates of a point, e.g. Berlin or another city.  In 
postgres i can do:

psql -d gis
select * from planet_osm_point where name = 'Berlin';

Now several data are shown.  Which of them are the coordinates?

And even more important, how do i convert it to latitude / longitude (in 
fractions, don't need minutes and seconds).

Or is there a more convenient way in Mapnik available?


Thanks for any hints,
Torsten.

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


Re: [OSM-talk] scale a ShapeFile in Y-direction?

2009-05-11 Thread Torsten Mohr
Hello,

thanks for taking a look at it.  The output is ~ 19000 lines, so i'll just
show the top ~70 lines:

Had to open data source read-only.
INFO: Open of `world_boundaries_m.shp'
  using driver `ESRI Shapefile' successful.

Layer name: world_boundaries_m
Geometry: Polygon
Feature Count: 3807
Extent: (-20037400.00, -19929239.11) - (20037400.00, 
18375854.709643)
Layer SRS WKT:
PROJCS[Mercator,
GEOGCS[GCS_WGS_1984,
DATUM[WGS_1984,
SPHEROID[WGS_1984,6378137,298.257223563]],
PRIMEM[Greenwich,0],
UNIT[Degree,0.017453292519943295]],
PROJECTION[Mercator_1SP],
PARAMETER[latitude_of_origin,0],
PARAMETER[central_meridian,0],
PARAMETER[scale_factor,1],
PARAMETER[false_easting,0],
PARAMETER[false_northing,0],
UNIT[Meter,1]]
CAT: Real (16.0)
FIPS_CNTRY: String (80.0)
CNTRY_NAME: String (80.0)
OGRFeature(world_boundaries_m):0
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):1
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):2
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):3
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):4
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):5
  CAT (Real) =   15
  FIPS_CNTRY (String) = AY
  CNTRY_NAME (String) = Antarctica

OGRFeature(world_boundaries_m):6
  CAT (Real) =  174
  FIPS_CNTRY (String) = NZ
  CNTRY_NAME (String) = New Zealand

OGRFeature(world_boundaries_m):7
  CAT (Real) =  174
  FIPS_CNTRY (String) = NZ
  CNTRY_NAME (String) = New Zealand

OGRFeature(world_boundaries_m):8
  CAT (Real) =  174
  FIPS_CNTRY (String) = NZ
  CNTRY_NAME (String) = New Zealand


It additionally tells me on stderr:
ERROR 4: Unable to open world_boundaries_m.shp or world_boundaries_m.SHP.


Thanks for any hints,
Torsten.


Am Montag, 11. Mai 2009 12:42:44 schrieb Juan Lucas Dominguez Rubio:
 Hi:

 I'm curious about that shapefile that needs some stretching. Assuming its
 name is filename.shp, try to type this:

 ogrinfo -geom=NO filename.shp filename

 what is the output?

 Regards,
 Juan Lucas


 




   Hello Frederik,

   thanks for your hint. Yes, i know about projections.  Actually, 
 i
 reprojected the rester images of blue marble from a form of WGS84 to
 Mercaator with an own program.

   But as i've heard it, world_boundaries_m is defect.  But as 
 an overlay
   to represent the boundaries it would be ok.  If that 
 information was a
   misunderstanding and could be fixed with the right projection 
 that would
 be awesome.

   If i use shoreline_300 instead, the projection is perfectly 
 fine, but if
 you try to render it _not_filled_ with a LineSymbolizer instead of a
 PolygonSymbolizer, you get some disturbing plates.  But the projection is
 fine.

   A ShapeFile contains the source SRS inside it, right?  When 
 rendering
   world_boundaries_m and shoreline_300 i used the same target 
 SRS.
   But the result leads to different positions on the final map.

   Does that mean that world_boundaries_m is defect?

   Is there a way to fix it somehow?  Or would scaling be 
 possible?


   Best regards,
   Torsten.

Hi,
   
Torsten Mohr wrote:
 I have a ShapeFile that seems to be incorrect, scaling it in
 Y-direction could make it fit the background.
   
Do you have a basic understanding of coordinate projections? 
 If not,
you'd be well advised to spend a few hours reading on the 
 subject
(start with Wikipedia, take it from there).
   
You need to find out which projection your shapefile is in, 
 and then
set the correct one in your map file, and things are likely 
 to work.
Simply stretching the data from the shapefile is very 
 unlikely to yield
the desired results - you will probably find that the stretch 
 factor
that makes Iceland and the Equator fit will still have France 
 out of
place.
   
Bye
Frederik

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


___
talk mailing list
talk@openstreetmap.org
http

Re: [OSM-talk] scale a ShapeFile in Y-direction?

2009-05-11 Thread Torsten Mohr
. 
But as an overlay to represent the boundaries it would be ok. 
  If that
information was a misunderstanding and could be fixed with 
 the right
projection that would be awesome.
   
  If i use shoreline_300 instead, the projection 
 is
perfectly fine, but if you try to render it _not_filled_ with 
 a
LineSymbolizer instead of a PolygonSymbolizer, you get some 
 disturbing
plates.  But the projection is fine.
   
  A ShapeFile contains the source SRS inside 
 it, right? 
When rendering world_boundaries_m and shoreline_300 i used 
 the same
target SRS. But the result leads to different positions on 
 the final
map.
   
  Does that mean that world_boundaries_m is 
 defect?
   
  Is there a way to fix it somehow?  Or would 
 scaling be
possible?
   
   
  Best regards,
  Torsten.
   
   Hi,
  
   Torsten Mohr wrote:
I have a ShapeFile that seems to be 
 incorrect,
scaling it in Y-direction could make it fit 
 the
background.
  
   Do you have a basic understanding of 
 coordinate
   projections? If not, you'd be well advised to 
 spend a
   few hours reading on the subject (start with 
 Wikipedia,
   take it from there).
  
   You need to find out which projection your 
 shapefile is
   in, and then set the correct one in your map 
 file, and
   things are likely to work. Simply stretching 
 the data
   from the shapefile is very unlikely to yield 
 the
   desired results - you will probably find that 
 the
   stretch factor that makes Iceland and the 
 Equator fit
   will still have France out of place.
  
   Bye
   Frederik
   
  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/listinfo/talk

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


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


Re: [OSM-talk] SQL

2009-05-10 Thread Torsten Mohr
Hello,

i just found out that the missing states are called:

Freistaat Bayern
Freistaat Sachsen
Freistaat Thüringen

That was the problem.


Best regards,
Torsten.


 On Sun, 2009-05-10 at 06:49 +0200, Torsten Mohr wrote:
  I also tried to access Thüringen by its osm_id, but also no success.
 
  In PSQL gis:
 
  gis= select osm_id, name from planet_osm_polygon where name like
  'Thüringen'
  limit 1000;
   osm_id |   name
  +---
   -76689 | Thüringen
  (1 Zeile)
 
 
  Can anybody tell me how to draw the three missing states?
 
  Is there an explanation why they are missing?

 Since the entry is in the polygon table, the only obvious problem I can
 think of is the direction of the polygon, clockwise vs
 counter-clockwise. Mapnik  Postgis really want all polygons to be
 clockwise but the osm2pgsql code does not guarantee this. Try doing:

 $ psql gis
 gis= update planet_osm_polygon set way=ST_Reverse(way) where
 osm_id=-76689;

 On older versions of postgis, ST_Reverse(way) might need to
 reverse(way).

  Is it possible to access parts from PostGIS by their osm_id from
  osm.xml?

 Filtering on osm_id should work, but it would be better to put this into
 a WHERE osm_id=... clause in the datasource query.

   Jon


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


Re: [OSM-talk] SQL, Where are Thüringen , Bayern a nd Sachsen?

2009-05-10 Thread Torsten Mohr
Hello Jon,

thanks a lot for your hints.

I just tried updating the entry for Thüringen, but it did not help,
Thüringen was not drawn.

I actually tried it the way you described, in one try i had an own Layer
für Thüringen with an own Style without Filter.  In the Layer i changed
the SQL query to look for a special osm_id.

I also just tried in SQL:
update planet_osm_polygon set name='thueringen' where osm_id=-76689;

It seems the name was not the problem, it did not improve the issue.

One more thing i just found out:
select way from planet_osm_polygon where name='Hessen';
way in Hessen gives much more data than way in Thüringen.

I don't think that entry even represents the boundary of Thüringen.


It looks to me my question was wrong, it seems to me it should be
Why are Thüringen, Bayern and Sachsen missing?

Is there a way to find out which entry represents the boundarys of
the missing federal states?


Thanks for any hints,
Torsten.


Am Sonntag, 10. Mai 2009 14:19:35 schrieb Jon Burgess:
 On Sun, 2009-05-10 at 06:49 +0200, Torsten Mohr wrote:
  I also tried to access Thüringen by its osm_id, but also no success.
 
  In PSQL gis:
 
  gis= select osm_id, name from planet_osm_polygon where name like
  'Thüringen'
  limit 1000;
   osm_id |   name
  +---
   -76689 | Thüringen
  (1 Zeile)
 
 
  Can anybody tell me how to draw the three missing states?
 
  Is there an explanation why they are missing?

 Since the entry is in the polygon table, the only obvious problem I can
 think of is the direction of the polygon, clockwise vs
 counter-clockwise. Mapnik  Postgis really want all polygons to be
 clockwise but the osm2pgsql code does not guarantee this. Try doing:

 $ psql gis
 gis= update planet_osm_polygon set way=ST_Reverse(way) where
 osm_id=-76689;

 On older versions of postgis, ST_Reverse(way) might need to
 reverse(way).

  Is it possible to access parts from PostGIS by their osm_id from
  osm.xml?

 Filtering on osm_id should work, but it would be better to put this into
 a WHERE osm_id=... clause in the datasource query.

   Jon



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


Re: [OSM-talk] SQL

2009-05-10 Thread Torsten Mohr
Hello,

i just found out that the missing states are called:

Freistaat Bayern
Freistaat Sachsen
Freistaat Thüringen

That was the problem.


Best regards,
Torsten.


 On Sun, 2009-05-10 at 06:49 +0200, Torsten Mohr wrote:
  I also tried to access Thüringen by its osm_id, but also no success.
 
  In PSQL gis:
 
  gis= select osm_id, name from planet_osm_polygon where name like
  'Thüringen'
  limit 1000;
   osm_id |   name
  +---
   -76689 | Thüringen
  (1 Zeile)
 
 
  Can anybody tell me how to draw the three missing states?
 
  Is there an explanation why they are missing?

 Since the entry is in the polygon table, the only obvious problem I can
 think of is the direction of the polygon, clockwise vs
 counter-clockwise. Mapnik  Postgis really want all polygons to be
 clockwise but the osm2pgsql code does not guarantee this. Try doing:

 $ psql gis
 gis= update planet_osm_polygon set way=ST_Reverse(way) where
 osm_id=-76689;

 On older versions of postgis, ST_Reverse(way) might need to
 reverse(way).

  Is it possible to access parts from PostGIS by their osm_id from
  osm.xml?

 Filtering on osm_id should work, but it would be better to put this into
 a WHERE osm_id=... clause in the datasource query.

   Jon



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


Re: [OSM-talk] SQL, Where are Thüringen , Bayern a nd Sachsen?

2009-05-10 Thread Torsten Mohr
Hello Jon,

thanks a lot for your hints.

I just tried updating the entry for Thüringen, but it did not help,
Thüringen was not drawn.

I actually tried it the way you described, in one try i had an own Layer
für Thüringen with an own Style without Filter.  In the Layer i changed
the SQL query to look for a special osm_id.

I also just tried in SQL:
update planet_osm_polygon set name='thueringen' where osm_id=-76689;

It seems the name was not the problem, it did not improve the issue.

One more thing i just found out:
select way from planet_osm_polygon where name='Hessen';
way in Hessen gives much more data than way in Thüringen.

I don't think that entry even represents the boundary of Thüringen.


It looks to me my question was wrong, it seems to me it should be
Why are Thüringen, Bayern and Sachsen missing?

Is there a way to find out which entry represents the boundarys of
the missing federal states?


Thanks for any hints,
Torsten.


Am Sonntag, 10. Mai 2009 14:19:35 schrieb Jon Burgess:
 On Sun, 2009-05-10 at 06:49 +0200, Torsten Mohr wrote:
  I also tried to access Thüringen by its osm_id, but also no success.
 
  In PSQL gis:
 
  gis= select osm_id, name from planet_osm_polygon where name like
  'Thüringen'
  limit 1000;
   osm_id |   name
  +---
   -76689 | Thüringen
  (1 Zeile)
 
 
  Can anybody tell me how to draw the three missing states?
 
  Is there an explanation why they are missing?

 Since the entry is in the polygon table, the only obvious problem I can
 think of is the direction of the polygon, clockwise vs
 counter-clockwise. Mapnik  Postgis really want all polygons to be
 clockwise but the osm2pgsql code does not guarantee this. Try doing:

 $ psql gis
 gis= update planet_osm_polygon set way=ST_Reverse(way) where
 osm_id=-76689;

 On older versions of postgis, ST_Reverse(way) might need to
 reverse(way).

  Is it possible to access parts from PostGIS by their osm_id from
  osm.xml?

 Filtering on osm_id should work, but it would be better to put this into
 a WHERE osm_id=... clause in the datasource query.

   Jon


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


Re: [OSM-talk] scale a ShapeFile in Y-direction?

2009-05-10 Thread Torsten Mohr
Hello Frederik,

thanks for your hint. Yes, i know about projections.  Actually, i reprojected
the rester images of blue marble from a form of WGS84 to Mercaator
with an own program.

But as i've heard it, world_boundaries_m is defect.  But as an overlay
to represent the boundaries it would be ok.  If that information was a
misunderstanding and could be fixed with the right projection that would be
awesome.

If i use shoreline_300 instead, the projection is perfectly fine, but if you
try to render it _not_filled_ with a LineSymbolizer instead of a
PolygonSymbolizer, you get some disturbing plates.  But the projection
is fine.

A ShapeFile contains the source SRS inside it, right?  When rendering
world_boundaries_m and shoreline_300 i used the same target SRS.
But the result leads to different positions on the final map.

Does that mean that world_boundaries_m is defect?

Is there a way to fix it somehow?  Or would scaling be possible?


Best regards,
Torsten.


 Hi,

 Torsten Mohr wrote:
  I have a ShapeFile that seems to be incorrect, scaling it in Y-direction
  could make it fit the background.

 Do you have a basic understanding of coordinate projections? If not,
 you'd be well advised to spend a few hours reading on the subject (start
 with Wikipedia, take it from there).

 You need to find out which projection your shapefile is in, and then set
 the correct one in your map file, and things are likely to work. Simply
 stretching the data from the shapefile is very unlikely to yield the
 desired results - you will probably find that the stretch factor that
 makes Iceland and the Equator fit will still have France out of place.

 Bye
 Frederik


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


[OSM-talk] SQL

2009-05-09 Thread Torsten Mohr
Hello,

when connecting to PostGIS and querying for german federal states
i can find them all in either:

planet_osm_line
planet_osm_polygon

It also is no problem to find states with special characters like in
Baden-Württemberg.

But no matter what i do, i don't find Bayern and Sachsen.  I do
find Thüringen but it is not drawn when used in osm.xml.

I try drawing the states with (works for all except the three mentioned):


Style name=grmnx
Rule
  Filter[name] = 'FILL_STATE_NAME_IN_HERE'/Filter
  MaxScaleDenominator2500/MaxScaleDenominator
  MinScaleDenominator60/MinScaleDenominator

  LineSymbolizer
CssParameter name=stroke#FF6565/CssParameter
  /LineSymbolizer
/Rule
/Style


Layer name=grmny status=on srs=+proj=merc +a=6378137 +b=6378137 
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null 
+no_defs +over
StyleNamegrmnx/StyleName
Datasource
  Parameter name=typepostgis/Parameter
  Parameter name=usertmohr/Parameter
  Parameter name=dbnamegis/Parameter
  Parameter name=table(select * from planet_osm_polygon order by 
z_order,way_area desc) as grmnx/Parameter
  Parameter name=estimate_extentfalse/Parameter
  Parameter 
name=extent-20037508,-19929239,20037508,19929239/Parameter
/Datasource
/Layer

Layer name=grmnx status=on srs=+proj=merc +a=6378137 +b=6378137 
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null 
+no_defs +over
StyleNamegrmnx/StyleName
Datasource
  Parameter name=typepostgis/Parameter
  Parameter name=usertmohr/Parameter
  Parameter name=dbnamegis/Parameter
  Parameter name=table(select * from planet_osm_line order by 
z_order,way_area desc) as grmnx/Parameter
  Parameter name=estimate_extentfalse/Parameter
  Parameter 
name=extent-20037508,-19929239,20037508,19929239/Parameter
/Datasource
/Layer


I also tried to access Thüringen by its osm_id, but also no success.

In PSQL gis:

gis= select osm_id, name from planet_osm_polygon where name like 'Thüringen' 
limit 1000;
 osm_id |   name
+---
 -76689 | Thüringen
(1 Zeile)


Can anybody tell me how to draw the three missing states?

Is there an explanation why they are missing?

Is it possible to access parts from PostGIS by their osm_id from osm.xml?



Thanks for any hints,
Torsten.


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


Re: [OSM-talk] Borders of the federal states of Germany (again)

2009-05-07 Thread Torsten Mohr
Hello Jukka,


that looks very interesting!  Thanks a lot!

With a query like:

select * from planet_osm_line where boundary is not null and name like 
'Schleswig%' LIMIT 100; 

I get exactly one entry with heaps of data, seems it represents Schleswig-
Holstein, a federal state.

Seems it needs some refinement, it doesn't seem to work for Bayern
or some others.  But those seem to be in planet_osm_polygon then.


Is there a way to create a ShapeFile from these data?

Or something i can import into QGIS?


Thanks a lot,
Torsten.


Am Donnerstag, 7. Mai 2009 08:15:14 schrieb Jukka Rahkonen:
 Torsten Mohr tmohr at s.netic.de writes:
  Hello,
 
  this issue is not related to another post that i did here regarding the
  outline of the world (shoreline_300).
 
  I want to create a map of Germany with many details, especially the
  federal states should have different background colors.
 
  I got a hint already for a ShapeFile that contains these data.  That file
  looked great, but the borderlines defined in there are _much_ more coarse
  than the data in the PostGIS, so creating the background from the
  rough, coarse data does not look that good.  It does not match the
  borders that are drawn.
 
  Is there a way to get the border information from the PostGIS server
  that runs locally on my machine?

 Hi,

 Import osm data into PostGIS with osm2pgsql utility and query borders with
 SQL query like
 SELECT * FROM osm_line WHERE admin_level is not null;

 At least in the Finnish data excerpt the borders are lines.  For making
 coloured areas border lines must first be converted to polygons.  Last step
 is to draw  the states with different colours for example by adding a
 single value theme looking at state name etc. All this can be done with
 OpenJUMP, QGis, uDig, gvSIG etc.


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


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


Re: [OSM-talk] gdalwarp question

2009-05-06 Thread Torsten Mohr
Hello Jukka,

no, thanks for your help, any hint and discussion is really appreciated.

 Sorry, I misunderstood a bit what you were going to do.  It may well be
 that for Mapnik you'll need to reproject raster image first. I do not much
 about Mapnik and while a have been using gdal utilities very much I don't
 believe I have ever needed to create output in Google projection.
 By first look what you have done does make sense. You can make a couple of
 further tests:

I solved the issue now in a different way.  Based on information on wikipedia
about mercaator projection i did the reprojection of the blue marble myself.
It took quite a while to execute, but the reprojection itself worked quite
fine.

Now the borders (shoreline_300) are exactly on the borders of the continents
and islands on the blue marble.

The relevant part of the script i use is attached below, if anybody is
interested please write me an email (i use an own library to handle the
images themselves, that part needs to be adapted to e.g. PyImage).

Thank you all for providing me help, i hope the script below is of value to
anybody.


Best regards,
Torsten.


#! /usr/bin/python
#coding: latin-1

import ri
from math import *
import gc
import sys

#he = 21600
he = 43200
np = 8
skp_a = 90.0 - (atan(sinh(pi)) * 180.0 / pi)
print skp_a
skp_p = int(he * skp_a / 90.0)
print skp_p

#sys.exit(0)

pat = '/local/vid/earth/strs_%i.tif'

max_phi = atan(sinh(pi))
print max_phi, max_phi * 180 / pi


def do_img(img, i):
wi = img.width()
hi = img.height()
yi0 = hi / 2

wo = wi
ho = he
yo0 = ho / 2

print i, i, wo, wo, ho, ho

out = ri.Ri(wo, ho, 1, 0)

for x in range(wo):
for ydo in range(ho / 2):
yn = float(ydo) / (ho / 2) * pi

phi = asin(tanh(yn))
ydi = phi / max_phi * (hi / 2)

r, g, b, a = img.get(x, int(yi0 + ydi))
out.set(x, int(yo0 + ydo), r, g, b)

r, g, b, a = img.get(x, int(yi0 - ydi))
out.set(x, int(yo0 - ydo), r, g, b)

out.saveAsPng(/local/vid/earth/ta_%i.png % (i))
del out


for i in range(4, np):
img = ri.Ri(pat % (i), ri.TIFF)
do_img(img, i)
del img
gc.collect()


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


[OSM-talk] shoreline_300, world borders _without_ rectangles

2009-05-06 Thread Torsten Mohr
Hello,

i'm glad i got the blu marble working nw and can create a map of the whole
world with the satellite images of the earth as background.  It looks really
great.

But what would be great if i could also overlay the world / continents /
islands / states borders as outline.

I can't use the shoreline_300 file as it is split into several polygons
and adds heaps of plates to the earth and does not look good.

Does anybody know a way to get the world outline (as in shoreline_300)
but without the plates (interruptions of the polygons)?

Is it maybe possible to get these data from PostGIS with a clever SQL
request?


Thanks for any hints,
Torsten.


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


[OSM-talk] Borders of the federal states of Germany (again)

2009-05-06 Thread Torsten Mohr
Hello,

this issue is not related to another post that i did here regarding the
outline of the world (shoreline_300).

I want to create a map of Germany with many details, especially the
federal states should have different background colors.

I got a hint already for a ShapeFile that contains these data.  That file
looked great, but the borderlines defined in there are _much_ more coarse
than the data in the PostGIS, so creating the background from the
rough, coarse data does not look that good.  It does not match the
borders that are drawn.

Is there a way to get the border information from the PostGIS server
that runs locally on my machine?

Things i tried so far:
- Google for it
- Get the data from PostGIS with SQL commands
- Download the single federal states from www.geofabrik.de
  as ShapeFiles and then find out they don't contain the borders.
- Download Germany.shp from www.geofabrik.de
  as ShapeFiles and then find out they don't contain the borders.
- Install QGIS and try to get the data from PostGIS (failed as my
  PostGIS installation does not seem to support GEOS).

With the last topic there could still be a chance to get a result, i still
need to try that.  But it means to re-install PostGIS and add some
steps that i'm not yet sure about (GEOS support).


It would be great if anybody had a hint on this.


Thanks for any hints,
Torsten.


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


Re: [OSM-talk] gdalwarp question

2009-05-03 Thread Torsten Mohr
Hello Jukka,

thanks for your hint, but to my understanding this contradicts
the description of RasterImage in Mapnik and the web page
that converts blue marble using gdalwarp.

In the documentation for RasterImage it says that Mapnik
can't (yet) reproject reaster image data, they have to match
the target projection.  I got that answer to another question:

http://www.mail-archive.com/mapnik-us...@lists.berlios.de/msg01213.html


So if in osm.xml there is:

srs=+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
+x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs +over

Then i think this should be the target projection (if i want to mix a raster
image into it).


The blue marble has lat / lon directly mapped to x / y coordinates.
To my understanding this is similar to WGS84, to add the scaling
with a world file makes sense to me.

Looking at this page  i see a description of projections and the use of
gdalwarp that describes how to get

http://egb13.net/2009/04/bending-the-earth-gdalwarp-and-the-blue-marble/


But in the end, my understanding did not leave to a correctly projected
image...


Best regards,
Torsten.


Am Sonntag, 3. Mai 2009 14:11:06 schrieb Jukka Rahkonen:
 Torsten Mohr tmohr at s.netic.de writes:
  Hello,
 
  thanks for that hint.
 
  Right, the chosen projection won't work around the poles, i don't expect
  that.  In the call to gdalwarp i gave the source projection (EPSG:4326 or
  WGS84) and as target projection i gave the projection used in osm.xml.

 Hi,

 Your target projection is the so called Google projection, or epsg:900913,
 or nowadays officially epsg:3785.  It is the projection used in OSM slippy
 map, but the native OSM data are in epsg:4326.  Therefore you should warp
 the downloaded images _into_ epsg:4326, not from that.  Unfortunately I
 cannot say what would be the correct source projection definition for your
 original images.

 An easy way to test your warped images is to download some OSM data in
 shapefile format and in epsg:4326 projection from Geofabrik.de, open the
 warped image with some GIS program like QGis or OpenJUMP together with OSM
 shapefile and see if they suit well together.

 Gdalwarp options are documented at http://gdal.org/gdalwarp.html but some
 further reading may be necesssary to understand what all the options mean.

 -Jukka Rahkonen-



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


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


Re: [OSM-talk] gdalwarp question

2009-05-03 Thread Torsten Mohr
Awesome!  Congratulations, i envy you.

I did not want to mislead people, maybe a misunderstanding?

I wrote in my mail that my understanding did not lead to a
correct image, i meant that somewhere there must be a
failure in my misunderstanding.
I did not want to say that gdalwarp does not work, it obviously
does work.


Has anybody got a hint on which of my assumptions is wrong?
a. The source SRS is epsg:4362
b. The target SRS should be as in osm.xml
c. Mapnik can not warp a raster image, it has to be pre-warped.
d. The world file of my TIF file is incorrect.
e. anything else?

I just tried the other hint of skipping the regions around the poles,
the height is 21600, which is +90.0 to -90.0.
I tried to go from +85.051128 to -85.051128 (atan(sinh(pi)) as
this was mentioned to be the limit of mercaator.
So i skipped 593 pixels at top and at bottom and changed the
world file for a strip generated like that:
0.00833507730103945403
0.00
0.00
-0.00833507730103945403
0.0
85.051128779806589

No success...

I began to reproject the blue marble with an own script but
there is a slight offset / scale yet.


Thanks for any hints,
Torsten.


 Please do not mislead people. gdalwarp works fine:

 http://tinyurl.com/germany-blue-marble

 Regards
 Juan Lucas





 




   Hello Jukka,

   thanks for your hint, but to my understanding this contradicts
   the description of RasterImage in Mapnik and the web page
   that converts blue marble using gdalwarp.

   In the documentation for RasterImage it says that Mapnik
   can't (yet) reproject reaster image data, they have to match
   the target projection.  I got that answer to another question:

   
 http://www.mail-archive.com/mapnik-us...@lists.berlios.de/msg01213.html


   So if in osm.xml there is:

   srs=+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
   +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs +over

   Then i think this should be the target projection (if i want to 
 mix a
 raster image into it).


   The blue marble has lat / lon directly mapped to x / y 
 coordinates.
   To my understanding this is similar to WGS84, to add the scaling
   with a world file makes sense to me.

   Looking at this page  i see a description of projections and 
 the use of
   gdalwarp that describes how to get

   
 http://egb13.net/2009/04/bending-the-earth-gdalwarp-and-the-blue-marble/


   But in the end, my understanding did not leave to a correctly 
 projected
   image...


   Best regards,
   Torsten.

   Am Sonntag, 3. Mai 2009 14:11:06 schrieb Jukka Rahkonen:
Torsten Mohr tmohr at s.netic.de writes:
 Hello,

 thanks for that hint.

 Right, the chosen projection won't work around the poles, i 
 don't
 expect that.  In the call to gdalwarp i gave the source 
 projection
 (EPSG:4326 or WGS84) and as target projection i gave the 
 projection
 used in osm.xml.
   
Hi,
   
Your target projection is the so called Google projection, or
epsg:900913, or nowadays officially epsg:3785.  It is the 
 projection
used in OSM slippy map, but the native OSM data are in 
 epsg:4326. 
Therefore you should warp the downloaded images _into_ 
 epsg:4326, not
from that.  Unfortunately I cannot say what would be the 
 correct source
projection definition for your original images.
   
An easy way to test your warped images is to download some 
 OSM data in
shapefile format and in epsg:4326 projection from 
 Geofabrik.de, open
the warped image with some GIS program like QGis or OpenJUMP 
 together
with OSM shapefile and see if they suit well together.
   
Gdalwarp options are documented at 
 http://gdal.org/gdalwarp.html but
some further reading may be necesssary to understand what all 
 the
options mean.
   
-Jukka Rahkonen-
   
   
   
___
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk

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


___
talk mailing list
talk

Re: [OSM-talk] gdalwarp question

2009-05-02 Thread Torsten Mohr
Hello,

i got much further converting an image with gdalwarp, mainly with these two
links:

http://egb13.net/2009/04/bending-the-earth-gdalwarp-and-the-blue-marble/
http://en.wikipedia.org/wiki/World_file

Basically i got the blue marble (high quality TIF image of the earth,
consists of two files, west and east, each has 21600 x 21600 pixel.

So i split the image into 8 strips, each 5400 x 21600.

For example str_4.tif is the 4th strip going fromnorth pole to south pole
left goes through Greenwhich, right stops just before the Horn of Africa
(west side).

I've created a world file str_4.tfw (i've added the comments just now):
0.0083 # delta x in angles per pixel
0.00  # no rotation
0.00  # no rotation
-0.0083 # delta y in angles per pixel
0.0  # upper left corner X
90.0 # upper left corner Y

Now i call gdalwarp to convert it to the SRS used in osm.xml:

gdalwarp
-s_srs EPSG:4326 
-t_srs '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 
+y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs +over'
str_4.tif 
cstr_4.tif

But cstr_4.tif is distorted, Africa is at 20% from the top, 40% from the top
begins Antarctica and goes down to the bottom (100%).


Is the world file incorrect?  Is the call to gdalwarp incorrect?

It would be great if anybody got a hint for me.


Also, i didn't find any explanation for the options of gdalwarp or
the parts in an SRS.  If anybody got an explanation that would be
appreciated.


Best regards,
Torsten.



Am Freitag, 1. Mai 2009 21:25:07 schrieb Juan Lucas Dominguez Rubio:
  Hello, i have an image that can be wrapped around
  a sphere, its x / y coordinates directly map to latitude / longitude.

 What do you mean by that?
 Do you mean that when you open it with some GIS app, the status bar tells
 the correct (lat, lon) of the place where the mouse is? Some GIS apps
 reproject raster files by default without explicitly letting the user know.
 Use this utility and tell us the output:

 gdalinfo filename

  Is that enough information to tell the SRS of that image?

 Strictly, no, but if we talk about (lat, lon), the EPSG:4326 coordinate
 system is by far the most common, so if your coordinates are originally in
 (lat, lon), they are very likely to be in EPSG:4326.

  Background is that i'd like to transform that image so it matches
  the SRS used in osm.xml.  Would that be WGS84?  Or is it called
  epsg:4326?  (Do they mean the same?)

 Yes, informally, when people say WGS84 they mean EPSG:4326. Ask Mr Google
 or the wikipedia for details

  Thanks for any hints, Torsten.

 Regards
 Juan Lucas


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


Re: [OSM-talk] gdalwarp question

2009-05-02 Thread Torsten Mohr
Hello,

thanks for that hint.

Right, the chosen projection won't work around the poles, i don't expect
that.  In the call to gdalwarp i gave the source projection (EPSG:4326 or
WGS84) and as target projection i gave the projection used in osm.xml.

But the result is not what i expected and i also can't explain it.


Best regards,
Torsten.


 On May 2, 2009, at 8:53 AM, Torsten Mohr wrote:
  But cstr_4.tif is distorted, Africa is at 20% from the top, 40%
  from the top
  begins Antarctica and goes down to the bottom (100%).

 There are a bunch of projections that don't work near the poles.  I'm
 not an expert, and my book on projections is home, but it's quite
 possible that your chosen projection cannot properly represent the
 poles.

 --
 Russ Nelson - http://community.cloudmade.com/blog -
 http://wiki.openstreetmap.org/wiki/User:RussNelson r...@cloudmade.com -
 Twitter: Russ_OSM - http://openstreetmap.org/user/RussNelson


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


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



Re: [OSM-talk] German Shapefile, federal states?

2009-05-01 Thread Torsten Mohr
Hello Juan,

thanks a lot for that link, it looks like this is exactly what i was searching
for.

Also, the hint to use a program like qgis was great, thanks to all your
hints.

It took me a while to find out that the scale of the data in PostGIS and
in shoreline_300 are different to the scale in germany.shp.

QGIS renders both with these settings:
+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs 

But the Polygons in germany are drawn at lat / lon 0 / 0, on the equator
before Africa.

Do i need to change that settings to make the Polygons match?


 Where do you want to draw that map?
I'm not sure if i understand you corectly, i want to render a huge map of 
Germany using the data in PostGIS.  But i want to show the federal states
in different colors.


Best regards,
Torsten.


Am Donnerstag, 30. April 2009 21:04:01 schrieb Juan Lucas Dominguez Rubio:
 Hello, Torsten. I think the 16 german federal states (lander) are available
 as a shapefile in lots of different places. Here is one example:

 http://wetnet.net/~we7u/xastir/maps/shapefile/Germany/

 That is a shapefile (compressed) with 16 polygons, and you also have the
 population and extension of each one. You have to open it with some GIS
 application. Where do you want to draw that map?

 Regards,
 Juan Lucas


 

 De: talk-boun...@openstreetmap.org en nombre de Torsten Mohr
 Enviado el: jue 30/04/2009 19:20
 Para: OSM Talk
 Asunto: Re: [OSM-talk] German Shapefile, federal states?



 Ouch, that's bad.

 i thought they'd contain some actual data, size implied that.

 I wonder if anybody knows a way to render the 16 German federal states
 (Bundesländer)?  Actually that's what i want to do in the end..

 Is there a way to find out what is in a Shapefile?  Like that i can write
 filters like

 Filter[CNTRY_NAME] = 'Germany'/Filter

 in world_boundaries_m?  Is there a way to find this out from a
 Shapefile?


 Thanks for any hints,
 Torsten.

 Am Mittwoch, 29. April 2009 23:06:18 schrieb Frederik Ramm:
  Hi,
 
  Torsten Mohr wrote:
   has anybody got some experience with the Shapefiles at:
   http://dataservice.eea.europa.eu/dataservice/metadetails.asp?id=760
 
  All I can see are shapefiles that contain a reference grid - no actual
  geodata?
 
  Bye
  Frederik

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


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


Re: [OSM-talk] German Shapefile, federal states?

2009-05-01 Thread Torsten Mohr
Awesome, thanks a lot.

It all worked fine, i converted the germany.shp as you mentioned.

I was not sure about the SRS of source and target, especially the parts
mentioned in osm.xml.  Googling for them did not help and ogr2ogr
also does not seem to explain them.


Best regards,
Torsten.


Am Freitag, 1. Mai 2009 11:19:21 schrieb Juan Lucas Dominguez Rubio:
 Hello,

 Yes, germany.shp is in +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
 (used by GPS devices ans by the OSM database), but shoreline_300 is in the
 spherical mercator projection, which is the projection used by OSM to
 _render_ the maps because it looks nicer than WGS84 and is widely used.

 So you either have to reproject germany.shp to spherical mercator (see
 attached screenshot) or reproject shoreline_300 to WGS84. To do this, you
 can use FWTools (http://fwtools.maptools.org). It includes command-line
 utilities:

 ogr2ogr -s_srs epsg:4326 -t_srs +proj=merc +a=6378137 +b=6378137
 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null
 +no_defs germany_sm.shp germany.shp

 OR

 ogr2ogr -s_srs +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0
 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgri...@null +no_defs -t_srs epsg:4326
 shoreline_300_wgs84.shp shoreline_300.shp

 (as you can see, the last two parameters are not source destination,
 but destination source)

 The EPSG code for WGS84 is EPSG:4326
 The EPSG code for WGS84 is EPSG:900913 or EPSG:3785 (synonyms)

 Regards,
 Juan Lucas


 

 De: talk-boun...@openstreetmap.org en nombre de Torsten Mohr
 Enviado el: vie 01/05/2009 10:30
 Para: OSM Talk
 Asunto: Re: [OSM-talk] German Shapefile, federal states?



 Hello Juan,

 thanks a lot for that link, it looks like this is exactly what i was
 searching for.

 Also, the hint to use a program like qgis was great, thanks to all your
 hints.

 It took me a while to find out that the scale of the data in PostGIS and
 in shoreline_300 are different to the scale in germany.shp.

 QGIS renders both with these settings:
 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

 But the Polygons in germany are drawn at lat / lon 0 / 0, on the equator
 before Africa.

 Do i need to change that settings to make the Polygons match?

  Where do you want to draw that map?

 I'm not sure if i understand you corectly, i want to render a huge map of
 Germany using the data in PostGIS.  But i want to show the federal states
 in different colors.


 Best regards,
 Torsten.

 Am Donnerstag, 30. April 2009 21:04:01 schrieb Juan Lucas Dominguez Rubio:
  Hello, Torsten. I think the 16 german federal states (lander) are
  available as a shapefile in lots of different places. Here is one
  example:
 
  http://wetnet.net/~we7u/xastir/maps/shapefile/Germany/
 
  That is a shapefile (compressed) with 16 polygons, and you also have the
  population and extension of each one. You have to open it with some GIS
  application. Where do you want to draw that map?
 
  Regards,
  Juan Lucas
 
 
  
 
  De: talk-boun...@openstreetmap.org en nombre de Torsten Mohr
  Enviado el: jue 30/04/2009 19:20
  Para: OSM Talk
  Asunto: Re: [OSM-talk] German Shapefile, federal states?
 
 
 
  Ouch, that's bad.
 
  i thought they'd contain some actual data, size implied that.
 
  I wonder if anybody knows a way to render the 16 German federal states
  (Bundesländer)?  Actually that's what i want to do in the end..
 
  Is there a way to find out what is in a Shapefile?  Like that i can write
  filters like
 
  Filter[CNTRY_NAME] = 'Germany'/Filter
 
  in world_boundaries_m?  Is there a way to find this out from a
  Shapefile?
 
 
  Thanks for any hints,
  Torsten.
 
  Am Mittwoch, 29. April 2009 23:06:18 schrieb Frederik Ramm:
   Hi,
  
   Torsten Mohr wrote:
has anybody got some experience with the Shapefiles at:
http://dataservice.eea.europa.eu/dataservice/metadetails.asp?id=760
  
   All I can see are shapefiles that contain a reference grid - no actual
   geodata?
  
   Bye
   Frederik
 
  ___
  talk mailing list
  talk@openstreetmap.org
  http://lists.openstreetmap.org/listinfo/talk

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


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


Re: [OSM-talk] German Shapefile, federal states?

2009-04-30 Thread Torsten Mohr
Ouch, that's bad.

i thought they'd contain some actual data, size implied that.

I wonder if anybody knows a way to render the 16 German federal states
(Bundesländer)?  Actually that's what i want to do in the end..

Is there a way to find out what is in a Shapefile?  Like that i can write
filters like

Filter[CNTRY_NAME] = 'Germany'/Filter

in world_boundaries_m?  Is there a way to find this out from a
Shapefile?


Thanks for any hints,
Torsten.



Am Mittwoch, 29. April 2009 23:06:18 schrieb Frederik Ramm:
 Hi,

 Torsten Mohr wrote:
  has anybody got some experience with the Shapefiles at:
  http://dataservice.eea.europa.eu/dataservice/metadetails.asp?id=760

 All I can see are shapefiles that contain a reference grid - no actual
 geodata?

 Bye
 Frederik


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


[OSM-talk] osm.xml, Filter, what tags are available?

2009-04-29 Thread Torsten Mohr
Hello,

looking into osm.xml i see Rules with Filters like:

Filter[tourism] = 'attraction'/Filter

How can i find out what tags (right wording?  I mean keywords like 'tourism')
are available?  What values could they have?

Background is that i want to write an own Rule (with Filter) for country
names, i want to highlight a country and render a map, so i want to
make other countries a bit darker so i can still see them but see the
borders of the highlighted country clearly.

So i guess the tags i want to filter are in world_borders.  Under what
tag are country names stored?

Does that make sense?  Is it clear what i want to do?

It would be great if anybody got a hint on this.


Best regards,
Torsten.



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


Re: [OSM-talk] osm.xml, Filter, what tags are available?

2009-04-29 Thread Torsten Mohr
Hi,

i just found out using a hex editor that the rule i need is:

Filter[CNTRY_NAME] = 'Germany'/Filter


It would be great to know if there is another way than using a hex editor,
has anybody got a hint?


Best regards,
Torsten.


Am Mittwoch, 29. April 2009 21:22:34 schrieb Torsten Mohr:
 Hello,

 looking into osm.xml i see Rules with Filters like:

 Filter[tourism] = 'attraction'/Filter

 How can i find out what tags (right wording?  I mean keywords like
 'tourism') are available?  What values could they have?

 Background is that i want to write an own Rule (with Filter) for country
 names, i want to highlight a country and render a map, so i want to
 make other countries a bit darker so i can still see them but see the
 borders of the highlighted country clearly.

 So i guess the tags i want to filter are in world_borders.  Under what
 tag are country names stored?

 Does that make sense?  Is it clear what i want to do?

 It would be great if anybody got a hint on this.


 Best regards,
 Torsten.



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


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


[OSM-talk] GPS logger

2009-04-27 Thread Torsten Mohr
Hi,

can anybody give me a hint on a GPS logger?  I'd just like to track the 
position on SD card.
It would be great if the battery would last for a week or even longer.

That should also be much cheaper than e.g. Garmin GPS devices.


Thanks for any hints,
Torsten.


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


[OSM-talk] rendering some large maps, e.g. whole world

2009-04-18 Thread Torsten Mohr
Hello,

i installed PostgreSQL / PostGIS and use a modified version of this
script to render maps:

svn.openstreetmap.org/applications/render/mapnik/generate_image.py

I've just created two maps of Germany, one is 12000 x 16000, the other
is 3000 x 4000.  I then get two different 'levels of detail', as expected.

I'd like to print a map of Germany as a poster.  My understanding is that
osm.xml is configured to create maps that look fine on a screen.
But the Pixels per Inch on a computer monitor are different compared to
the PPI on a printed poster.
So e.g. text size, symbol size and others may not look optimal when printed.

Has anybody got any experience with changing osm.xml to create maps
that look fine when printed (readable text, ...)?

Or do i worry too much and printing PNGs looks just all right?


2.
When rendering the whole world with coordinates like this:

# unused:   ll = (4.5, 46, 16, 56) # Germany
ll = (-180.0, -90.0, 180.0, 90.0) # World

Then i just get an empty file (just background).

Is this related to the scale denominators in osm.xml?

Can anybody give me a hint on what values to use when printing
the whole planet?



Thanks for any hints,
Torsten.


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


Re: [OSM-talk] rendering some large maps, e.g. whole world

2009-04-18 Thread Torsten Mohr
Hello,

thanks you very much for the answers, that helped _a_ _lot_ !

Lowering the latitude from 90.0 helped, now i can render the whole world.

I can now render a map of the world and i'm trying to scale certain parameters
so a printed map will look fine.


Best regards,
Torsten.



Am Samstag, 18. April 2009 10:34:06 schrieb D Tucny:
 2009/4/18 Torsten Mohr tm...@s.netic.de

  Hello,
 
  i installed PostgreSQL / PostGIS and use a modified version of this
  script to render maps:
 
  svn.openstreetmap.org/applications/render/mapnik/generate_image.py
 
  I've just created two maps of Germany, one is 12000 x 16000, the other
  is 3000 x 4000.  I then get two different 'levels of detail', as
  expected.
 
  I'd like to print a map of Germany as a poster.  My understanding is that
  osm.xml is configured to create maps that look fine on a screen.
  But the Pixels per Inch on a computer monitor are different compared to
  the PPI on a printed poster.
  So e.g. text size, symbol size and others may not look optimal when
  printed.
 
  Has anybody got any experience with changing osm.xml to create maps
  that look fine when printed (readable text, ...)?
 
  Or do i worry too much and printing PNGs looks just all right?

 A standard/typical print resolution is 300dpi, whereas a standard/typical
 screen resolution would be 96 dpi... So, if you had an image, viewed at
 native resolution, on a screen that took up an area 30cm by 30cm and looked
 good, to print it at it's native resolution the image would be 10cm by 10cm
 (approximately)... Your 12000 x 16000 image would be good for printing
 about 1m by 1.3m at 300dpi, any smaller and you would loose some of that
 resolution, any bigger and the image would start to appear pixelated...
 Your 3000 x 4000 image would be good for up to 25cm by 34cm at 300dpi...

 If you wanted to print an A0 poster, with no margins, you have a print area
 of 118.9cm by 84.1cm, so, an optimum resolution for your image would be
 14043 x 9933 if printing at 300dpi... If you view this image at 33% scale
 on your computer, you'll get a rough idea of the size of features when
 printed (though you may want to work out the real DPI of your screen if you
 want it to be more accurate, e.g. the screen I'm using now is 37.6cm wide
 with a horizontal resolution of 1280 pixels, or 86dpi, so I'd get more
 accurate feel of size by using a scale of 29% when viewing the image on
 screen)...

 The maps are typically rendered for viewing on a screen, so, text and
 symbols may appear too small when printed, you would likely need to adjust
 their size for print, but, how much you adjust it can be a taste thing...

 I haven't done it with a map myself, but others have and hopefully they
 will be able to contribute here with their experiences...

 2.

  When rendering the whole world with coordinates like this:
 
  # unused:   ll = (4.5, 46, 16, 56) # Germany
 ll = (-180.0, -90.0, 180.0, 90.0) # World
 
  Then i just get an empty file (just background).
 
  Is this related to the scale denominators in osm.xml?

 It likely is a combination of the scale and potentially a lack of the coast
 shapefiles... The lowest level of detail just has the coast line rendered
 from the shapefiles...

  Can anybody give me a hint on what values to use when printing
  the whole planet?

 To give accurate values, people would need to know what size image you will
 be looking to create, so, would need to know the size and resolution you
 will be printing at...

 Hope that helps...

 d


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


[OSM-talk] set up PostGIS with OSM data

2009-04-16 Thread Torsten Mohr
Hello,

i have two sources of information that seem to contradict sometimes,
maybe somebody can give me some hints?

I used subversion to checkout svn.openstreetmap.org.

After installing geos-3.1.0 i could compile and install osm2pgsql.

I also downloaded and installed postgis-1.3.5.

I've also set up PostgreSQL on my linux system.

In svn.openstreetmap.org/applications/rendering/mapnik/install.txt
i've read how to set up the tables in PostgreSQL (see below).
This description is missing on:
http://wiki.openstreetmap.org/wiki/Mapnik#World_Boundaries
Isn't it necessary?

snip
# some line breaks are added...

export user_name=tmohr

sudo -u postgres createuser -Upostgres -S -D -R $user_name
echo GRANT ALL ON SCHEMA PUBLIC TO \$user_name\; |
  sudo -u postgres psql -Upostgres gis
sudo -u postgres createlang plpgsql gis
sudo -u postgres psql -Upostgres gis /usr/share/postgresql/lwpostgis.sql \
 21 | grep -v -e 'FEHLER:  aktuelle Transaktion' \
 -e 'ERROR:  current transaction is aborted' \
 -e 'CREATE FUNCTION' -e OPERATOR
echo GRANT ALL on geometry_columns TO \$user_name\; |
  sudo -u postgres psql -Upostgres gis
echo GRANT ALL on spatial_ref_sys TO \$user_name\; |
  sudo -u postgres psql -Upostgres gis
echo GRANT ALL ON SCHEMA PUBLIC TO \$user_name\; |
  sudo -u postgres psql -Upostgres gis

/snip


I had also downloaded:

1. planet-090408.osm.bz2
2. relations-090408.osm.bz2  (what is this one for?  I did not use it at all.)
3. world_boundaries-spherical.tgz
4. processed_p.zip
5. shoreline_300.tar.bz2

I installed 3, 4 and 5, all files directly into
/usr/share/mapnik/world_boundaries.


Importing planet.osm as described on the openstreetmap wiki fails:

schleim:/local/ftp/osm # bzcat /local/ftp/osm/planet-090408.osm.bz2 |
  sudo -u postgres osm2pgsql -m -
osm2pgsql SVN version 0.65-14495

Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100

Reading in file: -
Processing: Node(330350k) Way(159k) Relation(0k)
Speicherzugriffsfehler
# The line above is German, means memory access error.


Can anybody give me a hint if  i've set  up something wrong?


Thanks for any hints,
Torsten.


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