MapWindow 4 - Desktop Application : MapWindow Discussion Forum
Trying to reproject a shapefile using MW 4.8.6. Regardless of which projection I select, it always responds with a message "failed to initialize the selected projection". When I right-click the projection (e.g.NAD83/BC Albers) and choose Properties, the resulting dialog box is mainly empt
4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 05, 2011 11:02AM

Trying to reproject a shapefile using MW 4.8.6. Regardless of which projection I select, it always responds with a message "failed to initialize the selected projection". When I right-click the projection (e.g.NAD83/BC Albers) and choose Properties, the resulting dialog box is mainly empty (e.g. Scope, Proj4, and Remarks).

I get the same results when using the latest version from SVN.

Am I doing something wrong, or is something else going on?

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: pmeems ()
Date: November 06, 2011 12:39PM

Jack,

If the properties are empty it means the projection is not recognized properly.
Most likely it is one of the numerous dialects every projections has.

What you can do is open the .prj file of your shapefile in Notepad.
Start a new project in MapWindow.
Double click the projections in the status bar.
Look up the projection in the three view, select it and go to the dialect tab.
Past here the proj4 string from the .prj file.

Now you can open your shapefile again. The projections should be properly recognized now and you should be able to reproject.

Can you send me the shapefile as well? I'll add the prj4 string as dialect to NAD83/BC Albers so other will benefit from it as well.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 06, 2011 05:57PM

Paul

I will try, but not sure if I am doing this correctly. I did not fully understand your instructions. Here are the steps I've carried out.

1 Open the .prj file, and copy the entire string to the windows clipboard

2. Open the shapefile. MW states that it is currently in WGS84 projection. That corresponds correctly with the origin of the file -- it should be plain lat/long data from a GPS receiver.

3. Click the WGS84 label in the lower-left corner of the MW window. Dialog box opens showing exactly one projection.

4. Projection name is WGS 84 and EPSG number is 4326. All other fields on all tabs in the dialog box are blank.

5. Choose the dialect tab. Paste the clipboard into the Projection String textbox.

6. Click OK. Re-open the dialog box. All fields are still empty.

7. Try something new... Click the "+" button in the Dialects tab. New dialog box opens with instructions to paste the proj4 or WKT string. Paste the string obtained from the .prj file. Click OK

8. MW issues an error message - "unable to initialize the base projection". Only recourse is to Cancel the dialog.


Abandon that process and try another tack.

1. Toolbox > Identify Projection
2. This string is displayed: +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs
(This is definitely NOT the same as the string from the .prj file)

3. Click the Identify button. Message is displayed that the projection was identified.

4. Repeat the two procedures shown earlier. Same results.




Something else:
1. Toolbox > Reproject Shapefile OR click the "down arrow" in the combo box in the lower-left corner of the MW window (where the current projection is displayed). Select "Choose projection" from the context menu.

2. Dialog box is displayed with treeview list of all the projections.


3. I have added several projections to the Favourites list.

4. Of all the projections that I look at, only one from the Favourites list ("Amersfoort / RD New") has any entries in the Dialects tab. All the others are blank. This strikes me as strange; I would have thought that all the projections would have some descriptive content.

If I understand correctly, MW now keeps its Projection info in a database (SQLLite???). I found a .db3 file in the ..\Projections\ MW subfolder, but did not know how to open it. It almost seems to me that MW is not opening the database properly.




Thanks for looking into this.


Jack

Attachments: reprojectTest.zip (148.2 KB)  
Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 06, 2011 06:28PM

Paul
Tried one more thing -- and I may be off-base here but it seems like data are missing from the Projections database...

Downloaded and installed an SQLite viewer, and opened the Projections.db3 file in the MapWindow\Projections folder. Then opened the Dialects table. There were only 6 entries in the table.

Should there be at least one entry for each Dialect (just guessing!)

Jack

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: pmeems ()
Date: November 07, 2011 06:16AM

Jack,

I understand it is confusing.
Let's start at the beginning.

The projections are 'grabbed' from the Proj4 library that is inside the ocx.
That library holds all the projection as stated in [spatialreference.org].
Some projections have dialects, like the one The Netherlands is using.
So we've added these known dialects to the dialects tab/table.
So it is no problem if you have only 6 dialects.

Now to your shapefile.
You have a shapefile with data from a GPS receiver. This data is in WGS84 (EPSG: 4326).
If the projection form shows the EPSG code it is properly recognized. The other fields however should not be empty.
The Scope and Proj4 text boxes on the Decription tab should be filled.
The area of use should show the whole world in a small map.
The ESRI WKT tab should show:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]
The dialect tab can be empty (probably is).

When I open your gpsP7 shapefile I see the projection is correct on my copy of MW.

About the 'Identify projection' tool.
It shows the prj4 string. If it shows anything it means it is properly recognized.
Your .prj file contains the ESRI WKT version of the same projection.

I've reprojected your shapefile to BC Albers (EPSG: 3005) without any problem (see attachment).

So my first reply was not correct. I thought you meant you have a shapefile in BC Albers that was not properly recognized. If that happens and you know the shapefile is in the same projection you can add the projection string to the Dialects tab.
In your case you want to reproject a file in WGS84 to BC Albers.

Can you try again? First start with the input shapefile. Is its projection recognized properly.
Next try to reproject.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Attachments: gpsP7.NAD83 - BC Albers.zip (176.6 KB)  
Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 07, 2011 06:46AM

Paul
Thanks for the clarification. I did not understand about it grabbing the Proj4 library information.



Now to your shapefile.
You have a shapefile with data from a GPS receiver. This data is in WGS84 (EPSG: 4326).
If the projection form shows the EPSG code it is properly recognized. The other fields however should not be empty.

*** that is where the problem starts - everything else *is* empty.





The Scope and Proj4 text boxes on the Decription tab should be filled.
The area of use should show the whole world in a small map.
The ESRI WKT tab should show:
GEOGCS["WGS 84",
DATUM["WGS_1984",


**** the ESRI WRT tab is empty


Any suggestions how to proceed from here? I suspect that because these fields are empty, then the reprojection cannot occur. Could there be a mis-match in the OCX because I have both SVN and the distributed 4.8.6 installed on this computer. The OCX have different version numbers. Help>About reports that MapWinGIS is 4.8.6

You have interpreted correctly now... I want to reproject from WGS84 to BC Albers.

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: pmeems ()
Date: November 07, 2011 07:14AM

It might be related to having multiple versions of MapWindow.
The SVN version should be the same as the one in the installer.
I've created and committed them at the same days.

Because you are familiar with SVN I want to suggest you delete the MapWindow folder the installer created. Most likely in <program files>.
Next you re-register the ocx from SVN using the cmd file.
That should make sure you're using the correct version.
To be completely sure you can delete your projection.db3 file and get a fresh one from SVN.

You're assumption is right. If the projection of the input file is not recognized properly the reprojection will fail.

Let me know if it helps.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 07, 2011 10:31PM

Paul -- some progress... installed fresh onto another computer, and it works properly.

So back to the original computer. Deleted the MW application and deleted the SVN folder. Used an "uninstaller" program to clean up the remnants of the MW installation. Then went thru the Registry and deleted a large number (~40-50) entries that pointed to MapWindow. Re-installed the MW application using the 4.8.6 installer.

But no joy - still no text visible in the Projections dialog box. So I am at a loss. Clearly there is something wrong with MW on the main computer, but I have no idea what it might be.

Whatever it is... it does not seem to be in any recognizable folder in the Program Files folder nor is it in the Registry with "mapwin" in its name.

Drat!

Jack

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: pmeems ()
Date: November 08, 2011 01:34PM

It's great to hear it is working on a fresh computer.

Now we know the installer is OK and we can focus on your main computer.
Are you running any non-standard virsus scanner, firewall, proxy servers?

Did you try running the installer as Admin and run MapWindow as Admin (right-click on the exe file and select Run as ..)

What version of Windows are you running? Win7, Vista?

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 08, 2011 06:49PM

Paul
You win the genius prize! Installing as Administrator did the trick.
Now when I look at the properties of various projections, they all have values in the different dialog boxes. Reprojecting the original file into BC Albers worked properly.

I can *run* MW as either Administrator or standard user, and it works properly. It was the installation as Administrator that made the difference.

I am more than willing to do more experimentation if it will help the project along -- this is definitely NOT a production computer, so installing and deleting under different conditions is acceptable.

Thanks very much for your help.

Jack

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: jacksonmacd ()
Date: November 08, 2011 07:06PM

Oh yeah...Win 7 Home Premium
The firewall and virus checker is Microsoft -- Windows Essentials. Nothing special.

Jack

Options: ReplyQuote
Re: 4.8.6 - Map projections not working
Posted by: pmeems ()
Date: November 09, 2011 03:42AM

I'm glad it is working now.
Although I still don't know what causes this.

Thanks for the feedback.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: