Re: [mapserver-users] Projection help
Next time you can prevent this grief by following the "Important Points" in the projections doc, when dealing with input & output projections, and extents: https://mapserver.org/mapfile/projection.html#important-notes I often use these concepts for debugging issues like this. -jeff -- Thank you for using MS4W. "MS4W: open doors as well as windows" -- Jeff McKenna MapServer Consulting and Training Services https://gatewaygeomatics.com/ On 2019-07-31 11:01 PM, Ian Walberg wrote: Steve, Actually that does work. Thanks Ian *From:* Ian Walberg *Sent:* Wednesday, July 31, 2019 7:00 PM *To:* 'Lime, Steve D (MNIT)' ; mapserver-users@lists.osgeo.org *Subject:* RE: Projection help Steve, Good point, I did have the extent in meters but that did not work. Should these work? EXTENT -20026376 -20048966 20026376 20048966 Thanks Ian *From:* Lime, Steve D (MNIT) <mailto:steve.l...@state.mn.us>> *Sent:* Wednesday, July 31, 2019 6:38 PM *To:* Ian Walberg <mailto:ian.walb...@airborne.aero>>; mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> *Subject:* Re: Projection help How are you setting an extent? The default extent you’re defining is in lat/lon. *From:*Ian Walberg <mailto:ian.walb...@airborne.aero>> *Sent:* Wednesday, July 31, 2019 5:34:05 PM *To:* Lime, Steve D (MNIT) <mailto:steve.l...@state.mn.us>>; mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> mailto:mapserver-users@lists.osgeo.org>> *Subject:* RE: Projection help *This message may be from an external email source.* Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center. Steve, The map file below draws a non Mercator projection and if the epsg:4326 line is uncommented then the map is blank. This is on a windows machine using Mapserver 7.0.7 from MS4W 3.2.6. Any ideas? Thanks Ian MAP NAME global_map STATUS ON SIZE 1024 600 EXTENT -180 -90 180 90 LAYER NAME "Earth_Vector" STATUS DEFAULT TYPE LINE DEBUG 3 PROJECTION # "init=epsg:4326" END DATA "../shp/land/ne_110m_land.shp" CLASS STYLE ANTIALIAS TRUE COLOR 0 255 0 WIDTH 1 END END END PROJECTION "init=epsg:3857" END END #MAP END *From:* Lime, Steve D (MNIT) <mailto:steve.l...@state.mn.us>> *Sent:* Wednesday, July 31, 2019 3:22 PM *To:* Ian Walberg <mailto:ian.walb...@airborne.aero>>; mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> *Subject:* RE: Projection help Should be straight forward. In the natural earth layers you’d have: PROJECTION "init=epsg:4326" # geographic END and at the MAP level you’d have: PROJECTION "init=epsg:3857" # web mercator END --Steve *From:* mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] *On Behalf Of *Ian Walberg *Sent:* Wednesday, July 31, 2019 4:56 PM *To:* mapserver-users@lists.osgeo.org <mailto:mapserver-users@lists.osgeo.org> *Subject:* [mapserver-users] Projection help Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help
Steve, Actually that does work. Thanks Ian From: Ian Walberg Sent: Wednesday, July 31, 2019 7:00 PM To: 'Lime, Steve D (MNIT)' ; mapserver-users@lists.osgeo.org Subject: RE: Projection help Steve, Good point, I did have the extent in meters but that did not work. Should these work? EXTENT -20026376 -20048966 20026376 20048966 Thanks Ian From: Lime, Steve D (MNIT) mailto:steve.l...@state.mn.us>> Sent: Wednesday, July 31, 2019 6:38 PM To: Ian Walberg mailto:ian.walb...@airborne.aero>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: Re: Projection help How are you setting an extent? The default extent you're defining is in lat/lon. From: Ian Walberg mailto:ian.walb...@airborne.aero>> Sent: Wednesday, July 31, 2019 5:34:05 PM To: Lime, Steve D (MNIT) mailto:steve.l...@state.mn.us>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> mailto:mapserver-users@lists.osgeo.org>> Subject: RE: Projection help This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center. Steve, The map file below draws a non Mercator projection and if the epsg:4326 line is uncommented then the map is blank. This is on a windows machine using Mapserver 7.0.7 from MS4W 3.2.6. Any ideas? Thanks Ian MAP NAME global_map STATUS ON SIZE 1024 600 EXTENT -180 -90 180 90 LAYER NAME "Earth_Vector" STATUS DEFAULT TYPE LINE DEBUG 3 PROJECTION #"init=epsg:4326" END DATA "../shp/land/ne_110m_land.shp" CLASS STYLE ANTIALIAS TRUE COLOR 0 255 0 WIDTH 1 END END END PROJECTION "init=epsg:3857" END END #MAP END From: Lime, Steve D (MNIT) mailto:steve.l...@state.mn.us>> Sent: Wednesday, July 31, 2019 3:22 PM To: Ian Walberg mailto:ian.walb...@airborne.aero>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: Projection help Should be straight forward. In the natural earth layers you'd have: PROJECTION "init=epsg:4326" # geographic END and at the MAP level you'd have: PROJECTION "init=epsg:3857" # web mercator END --Steve From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ian Walberg Sent: Wednesday, July 31, 2019 4:56 PM To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] Projection help Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help
Steve, Good point, I did have the extent in meters but that did not work. Should these work? EXTENT -20026376 -20048966 20026376 20048966 Thanks Ian From: Lime, Steve D (MNIT) Sent: Wednesday, July 31, 2019 6:38 PM To: Ian Walberg ; mapserver-users@lists.osgeo.org Subject: Re: Projection help How are you setting an extent? The default extent you're defining is in lat/lon. From: Ian Walberg mailto:ian.walb...@airborne.aero>> Sent: Wednesday, July 31, 2019 5:34:05 PM To: Lime, Steve D (MNIT) mailto:steve.l...@state.mn.us>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> mailto:mapserver-users@lists.osgeo.org>> Subject: RE: Projection help This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center. Steve, The map file below draws a non Mercator projection and if the epsg:4326 line is uncommented then the map is blank. This is on a windows machine using Mapserver 7.0.7 from MS4W 3.2.6. Any ideas? Thanks Ian MAP NAME global_map STATUS ON SIZE 1024 600 EXTENT -180 -90 180 90 LAYER NAME "Earth_Vector" STATUS DEFAULT TYPE LINE DEBUG 3 PROJECTION #"init=epsg:4326" END DATA "../shp/land/ne_110m_land.shp" CLASS STYLE ANTIALIAS TRUE COLOR 0 255 0 WIDTH 1 END END END PROJECTION "init=epsg:3857" END END #MAP END From: Lime, Steve D (MNIT) mailto:steve.l...@state.mn.us>> Sent: Wednesday, July 31, 2019 3:22 PM To: Ian Walberg mailto:ian.walb...@airborne.aero>>; mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: RE: Projection help Should be straight forward. In the natural earth layers you'd have: PROJECTION "init=epsg:4326" # geographic END and at the MAP level you'd have: PROJECTION "init=epsg:3857" # web mercator END --Steve From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ian Walberg Sent: Wednesday, July 31, 2019 4:56 PM To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] Projection help Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help
How are you setting an extent? The default extent you’re defining is in lat/lon. From: Ian Walberg Sent: Wednesday, July 31, 2019 5:34:05 PM To: Lime, Steve D (MNIT) ; mapserver-users@lists.osgeo.org Subject: RE: Projection help This message may be from an external email source. Do not select links or open attachments unless verified. Report all suspicious emails to Minnesota IT Services Security Operations Center. Steve, The map file below draws a non Mercator projection and if the epsg:4326 line is uncommented then the map is blank. This is on a windows machine using Mapserver 7.0.7 from MS4W 3.2.6. Any ideas? Thanks Ian MAP NAME global_map STATUS ON SIZE 1024 600 EXTENT -180 -90 180 90 LAYER NAME "Earth_Vector" STATUS DEFAULT TYPE LINE DEBUG 3 PROJECTION #"init=epsg:4326" END DATA "../shp/land/ne_110m_land.shp" CLASS STYLE ANTIALIAS TRUE COLOR 0 255 0 WIDTH 1 END END END PROJECTION "init=epsg:3857" END END #MAP END From: Lime, Steve D (MNIT) Sent: Wednesday, July 31, 2019 3:22 PM To: Ian Walberg ; mapserver-users@lists.osgeo.org Subject: RE: Projection help Should be straight forward. In the natural earth layers you’d have: PROJECTION "init=epsg:4326" # geographic END and at the MAP level you’d have: PROJECTION "init=epsg:3857" # web mercator END --Steve From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ian Walberg Sent: Wednesday, July 31, 2019 4:56 PM To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> Subject: [mapserver-users] Projection help Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help
Should be straight forward. In the natural earth layers you'd have: PROJECTION "init=epsg:4326" # geographic END and at the MAP level you'd have: PROJECTION "init=epsg:3857" # web mercator END --Steve From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Ian Walberg Sent: Wednesday, July 31, 2019 4:56 PM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Projection help Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Projection help
Hello, We have used different projections previously but cannot get them to work at the moment. All the examples we can find online look ok but do not make any difference to the generated map. A way of projecting the Natural Earth vector country outlines as Mercator would be a perfect example. Adding CONFIG "PROJ_DEBUG" "ON" does not appear to generate any output. Thanks Ian ___ mapserver-users mailing list mapserver-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help: proj command line
Hi Matthew, try cs2cs instead of proj, e.g. cs2cs +init=epsg:26915 +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 [EMAIL PROTECTED] +wktext +no_defs With proj you have to do the inverse projection from epsg:26915 (your from projection) to latlon/wgs84 (epsg:4326) first, proj -I -f %.8f +init=epsg:26915 In a second step project the resulting latlon coordinate into your to-projection: proj -f %.4f +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 [EMAIL PROTECTED] +wktext +no_defs Both version should work. Just for comparison, I got the following result for the first point of your extent: epsg:26915: 184056.505, 4809728.25 epsg:4326 : -96.89976708 43.37391004 your to projection: -10786832.7293 5369059.0540 I hope, that this is correct and will help. Dirk Hi, This question is tangential to Mapserver, but critical to me nonetheless. I'm trying to reproject a shapefile in a mapfile from = PROJECTION init=epsg:26915 END = to = PROJECTION +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 [EMAIL PROTECTED] +wktext +no_defs END = my extent in the 'from' projection are: = EXTENT 184056.505 4809728.25 767381.245 5478975.75 = Can someone help me figure out what my EXTENT should be in my 'to' projection? I've tried the following extents derived from the 'proj' command line outputs as extents, but was not successful: = $ proj -I -f %.4f +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 [EMAIL PROTECTED] +wktext +no_defs 184056.505 4809728.25 1.6534 39.6121 767381.245 5478975.75 6.8935 44.0874 $ proj -I -f %.4f +init=epsg:26915 184056.505 4809728.25 -96.899843.3739 767381.245 5478975.75 -89.314049.4047 = Anybody have any ideas what I am doing wrong? Do I somehow have to chain projections together to get from my 'from' projection to my 'to' projection? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Projection help: proj command line
That worked fantastically - Thank You Very Much! Matt On Mon, Jun 30, 2008 at 2:05 AM, Dirk Jesko [EMAIL PROTECTED] wrote: Hi Matthew, try cs2cs instead of proj, e.g. cs2cs +init=epsg:26915 +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 [EMAIL PROTECTED] +wktext +no_defs With proj you have to do the inverse projection from epsg:26915 (your from projection) to latlon/wgs84 (epsg:4326) first, proj -I -f %.8f +init=epsg:26915 In a second step project the resulting latlon coordinate into your to-projection: proj -f %.4f +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 [EMAIL PROTECTED] +wktext +no_defs Both version should work. Just for comparison, I got the following result for the first point of your extent: epsg:26915: 184056.505, 4809728.25 epsg:4326 : -96.89976708 43.37391004 your to projection: -10786832.7293 5369059.0540 I hope, that this is correct and will help. Dirk Hi, This question is tangential to Mapserver, but critical to me nonetheless. I'm trying to reproject a shapefile in a mapfile from = PROJECTION init=epsg:26915 END = to = PROJECTION +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 [EMAIL PROTECTED] +wktext +no_defs END = my extent in the 'from' projection are: = EXTENT 184056.505 4809728.25 767381.245 5478975.75 = Can someone help me figure out what my EXTENT should be in my 'to' projection? I've tried the following extents derived from the 'proj' command line outputs as extents, but was not successful: = $ proj -I -f %.4f +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 [EMAIL PROTECTED] +wktext +no_defs 184056.505 4809728.25 1.6534 39.6121 767381.245 5478975.75 6.8935 44.0874 $ proj -I -f %.4f +init=epsg:26915 184056.505 4809728.25 -96.899843.3739 767381.245 5478975.75 -89.314049.4047 = Anybody have any ideas what I am doing wrong? Do I somehow have to chain projections together to get from my 'from' projection to my 'to' projection? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- It is from the wellspring of our despair and the places that we are broken that we come to repair the world. -- Murray Waas ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users