<HTML dir=ltr><HEAD><TITLE>Re: [OSM-talk] "scale" a ShapeFile in Y-direction?</TITLE>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18372"></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText94882>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">Hi. Your file world_boundaries_m.shp seems to be in the old-fashioned EPSG:3395 we discussed a few days ago.<BR><BR></FONT><FONT color=#000000 size=3 face="Times New Roman">This should produce the shapefile you are looking for (world_boundaries_900913.shp):<BR><BR></FONT><FONT color=#000000 size=3 face="Times New Roman">ogr2ogr -f "ESRI Shapefile" -s_srs epsg:3395 -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 <A href="mailto:+nadgrids=@null">+nadgrids=@null</A> +no_defs +over" world_boundaries_900913.shp world_boundaries_m.shp<BR></FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman"></FONT> </DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman"> </DIV></FONT>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">regards<BR>Juan Lucas</FONT></DIV></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><BR></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<BLOCKQUOTE dir=ltr>
<HR tabIndex=-1>
<BR></BLOCKQUOTE>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<P><FONT size=2>Hello,<BR><BR>thanks for taking a look at it.  The output is ~ 19000 lines, so i'll just<BR>show the top ~70 lines:<BR><BR>Had to open data source read-only.<BR>INFO: Open of `world_boundaries_m.shp'<BR>      using driver `ESRI Shapefile' successful.<BR><BR>Layer name: world_boundaries_m<BR>Geometry: Polygon<BR>Feature Count: 3807<BR>Extent: (-20037400.000000, -19929239.110000) - (20037400.000000,<BR>18375854.709643)<BR>Layer SRS WKT:<BR>PROJCS["Mercator",<BR>    GEOGCS["GCS_WGS_1984",<BR>        DATUM["WGS_1984",<BR>            SPHEROID["WGS_1984",6378137,298.257223563]],<BR>        PRIMEM["Greenwich",0],<BR>        UNIT["Degree",0.017453292519943295]],<BR>    PROJECTION["Mercator_1SP"],<BR>    PARAMETER["latitude_of_origin",0],<BR>    PARAMETER["central_meridian",0],<BR>    PARAMETER["scale_factor",1],<BR>    PARAMETER["false_easting",0],<BR>    PARAMETER["false_northing",0],<BR>    UNIT["Meter",1]]<BR>CAT: Real (16.0)<BR>FIPS_CNTRY: String (80.0)<BR>CNTRY_NAME: String (80.0)<BR>OGRFeature(world_boundaries_m):0<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):1<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):2<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):3<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):4<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):5<BR>  CAT (Real) =               15<BR>  FIPS_CNTRY (String) = AY<BR>  CNTRY_NAME (String) = Antarctica<BR><BR>OGRFeature(world_boundaries_m):6<BR>  CAT (Real) =              174<BR>  FIPS_CNTRY (String) = NZ<BR>  CNTRY_NAME (String) = New Zealand<BR><BR>OGRFeature(world_boundaries_m):7<BR>  CAT (Real) =              174<BR>  FIPS_CNTRY (String) = NZ<BR>  CNTRY_NAME (String) = New Zealand<BR><BR>OGRFeature(world_boundaries_m):8<BR>  CAT (Real) =              174<BR>  FIPS_CNTRY (String) = NZ<BR>  CNTRY_NAME (String) = New Zealand<BR><BR><BR>It additionally tells me on stderr:<BR>ERROR 4: Unable to open world_boundaries_m.shp or world_boundaries_m.SHP.<BR><BR><BR>Thanks for any hints,<BR>Torsten.<BR><BR><BR>Am Montag, 11. Mai 2009 12:42:44 schrieb Juan Lucas Dominguez Rubio:<BR>> Hi:<BR>><BR>> I'm curious about that shapefile that needs some stretching. Assuming its<BR>> name is filename.shp, try to type this:<BR>><BR>> ogrinfo -geom=NO filename.shp filename<BR>><BR>> what is the output?<BR>><BR>> Regards,<BR>> Juan Lucas<BR>><BR>><BR>> ________________________________<BR>><BR>><BR>><BR>><BR>>               Hello Frederik,<BR>><BR>>               thanks for your hint. Yes, i know about projections.  Actually, i<BR>> reprojected the rester images of "blue marble" from a form of WGS84 to<BR>> Mercaator with an own program.<BR>><BR>>               But as i've heard it, world_boundaries_m is "defect".  But as an overlay<BR>>               to represent the boundaries it would be ok.  If that information was a<BR>>               misunderstanding and could be fixed with the right projection that would<BR>> be awesome.<BR>><BR>>               If i use shoreline_300 instead, the projection is perfectly fine, but if<BR>> you try to render it _not_filled_ with a LineSymbolizer instead of a<BR>> PolygonSymbolizer, you get some disturbing "plates".  But the projection is<BR>> fine.<BR>><BR>>               A ShapeFile contains the "source SRS" inside it, right?  When rendering<BR>>               world_boundaries_m and shoreline_300 i used the same "target SRS".<BR>>               But the result leads to different positions on the final map.<BR>><BR>>               Does that mean that world_boundaries_m is defect?<BR>><BR>>               Is there a way to "fix" it somehow?  Or would scaling be possible?<BR>><BR>><BR>>               Best regards,<BR>>               Torsten.<BR>><BR>>               > Hi,<BR>>               ><BR>>               > Torsten Mohr wrote:<BR>>               > > I have a ShapeFile that seems to be incorrect, scaling it in<BR>>               > > Y-direction could make it fit the background.<BR>>               ><BR>>               > Do you have a basic understanding of coordinate projections? If not,<BR>>               > you'd be well advised to spend a few hours reading on the subject<BR>>               > (start with Wikipedia, take it from there).<BR>>               ><BR>>               > You need to find out which projection your shapefile is in, and then<BR>>               > set the correct one in your map file, and things are likely to work.<BR>>               > Simply stretching the data from the shapefile is very unlikely to yield<BR>>               > the desired results - you will probably find that the stretch factor<BR>>               > that makes Iceland and the Equator fit will still have France out of<BR>>               > place.<BR>>               ><BR>>               > Bye<BR>>               > Frederik<BR>><BR>>               _______________________________________________<BR>>               talk mailing list<BR>>               talk@openstreetmap.org<BR>>               <A href="http://lists.openstreetmap.org/listinfo/talk">http://lists.openstreetmap.org/listinfo/talk</A><BR><BR><BR>_______________________________________________<BR>talk mailing list<BR>talk@openstreetmap.org<BR><A href="http://lists.openstreetmap.org/listinfo/talk">http://lists.openstreetmap.org/listinfo/talk</A><BR></FONT></P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>