1

I have changed the projections of some Natural Earth Shapefile to "WGS 84/Pseduo Mercator", that works fine (after cutting out the artic), but now the co ordinates of the shapefile are all out of wack.

I can display the shapefile(s) in my application (using MapWinGIS), but the lat longs that i'm passing for points etc are in decimal degrees and the shape file seems to be in something else - meters maybe?

What can i do to keep the shapefile in degrees, or is there a conversation between to two.

  • If you reproject data to Pseudo Mercator, the coordinates will be in (meters - but only correct at the equator). Why do you reproject if you want them in degrees? Please explain your requirements. – underdark Aug 5 '14 at 18:22
  • I want to change the visually appearance of the map when drawn. Is there a better option to select - I picked Pseduo Mercator, because thats what google/bing etc use. – Ross Aug 6 '14 at 8:11
  • @Ross does MapWinGIS have the ability to 'project data on the fly', that is, change the 'visual projection' of the data while leaving the 'coordinate projection' alone? – DPSSpatial Aug 6 '14 at 22:33
  • I'm not sures if the current version supports "on the fly": mapwingis.codeplex.com/discussions/346325 .I belive the next version might do. I'm working on a solution to this as we speak so will post back when I get it working - long term reprojecting on the fly might be best away... – Ross Aug 7 '14 at 8:07
0

I managed to get this working, and have written up the answer at: https://mapwingis.codeplex.com/discussions/560231

Here it is repeated in full:

Thanks Paul,

I tried a number of things, I tried reprojecting the map* on the fly, which although returned "true", and there was no error code in sf.get_ErrorMsg(sf.lastErrorCode)); - and even when I saved the shapefile it had the correct .prj file, the map display did not change.

After spending a lot of time tring diffrent conversions, none of which seemed to work quite right - always slightly misaligned, i came across this code:

https://stackoverflow.com/questions/11957538/converting-geographic-wgs-84-to-web-mercator-102100

Which worked a treat, so all good now.

I had also played with theres 2 methods but they did not work - I'm assuming the projection methods where just 2 different: even when I messed about with the constants I could not get the 2 shapefiles to lined up! http://blog.philenotfound.com/2010/09/vbaexcel-conversions-for-longitude.html http://forums.esri.com/Thread.asp?c=93&f=993&t=90718

I'll take a look at GeoProjection.Transform when i get a second though, many thanks

Ross

*https://mapwingis.codeplex.com/discussions/442899

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.