This project is read-only.

Current state of Reprojection ActiveX Control

Jul 11, 2011 at 7:08 PM

<before I raise any issues, this is my first post, and I'd like to introduce myself.  Skip the next section if you are not interested...>

Hello-- first of all , let me introduce myself.  My name is John Page, and I'm a IT solutions for a group in the US  that is providing health IT solutions for government agencies (such as the Centers for Disease Control, and the Health Resources and Services Administration.  )  Both groups are similar in that they are very interesting in viewing tabular data from multiple sources that has a geospatial component, but they've had trouble getting end users to really exploit the data since there are either proprietary restrictions or it is presumed that the users have high GIS skills to set projections, associated new sets of data with geographic regions,  manage multiple layers and symbology, etc.  What I've been doing is building a geospatial explorer into Excel, where a GIS novice can load, display, and interact with geospatial report data, and also export it into other formats.   ("GIS with trainingwheels for people that know spreadsheets.) I've been trying to keep everything to the current 4.7 stable release of the tool.  On the whole, I've VERY happy with MapWindow, and admire how it scales up in rendering over complex data.  To be honest, I've been able to come up with a workaround for every problem I've encountered so far-- but I may be stumped for this one.

<Now cutting to the chase>

I've been using the Lambert North American Conformal Conic for the projection in my MapWin Active X application-- it is a very elegant projection that is also pretty realistic for North America.  I've been developing the code in VBA.   But now I've been writing some code to output a selected set of shapes in a shapefile as KML, and I'm having problems with coordinates.  Evidently, if I parse the points for a given shape in the projection (Shapefile(shapeIndex).Point(thisPOint).x, etc) ( the coordinates are not in degrees-- I'm assuming they are in meters.  What I'd like to do is be able to retrieve them in Lon/Lat form so I can represent them in decimal degrees, which would be much friendlier for Google Earth.  

An ideal solution would be to be able to re-project each point to lon/lat prior to writing to KML, but I'm not sure if that sort of interface exists.

Another option would be to write the selected shapes to a new shapefile (I've seen a script for that), and then reproject that shapefile.  I'm not sure if 4.7 provides me a capability to reproject a shapefile using VBA. 

Another really twisted option would be to keep copies of both the original and Lambert-reprojected  versions of the shapefiles, and use the same IDs to correlate them, and only use the geographic files for doing the KML port but that seems very wasteful to me.

I'm sure I'd have more options using the MapWIndow client, but I'm trying to keep this as simple as possible for an end user.  Also, from what I gathered in earlier searches, it is not possible to "embed" a Plugin in with the ActiveX control.

Shape2Earth is VERY nice, but  I'm trying to minimize any cost dependencies (other than having Microsoft Office), so that this capability can deployed in more areas,  and also I've got some additional customizations  I need to make.  I've managed to get all of the KML code tested and working, but the coordinates are getting me.

Hopefully, I've not muddied the waters too far, but I guess a short version of my question is "what are the current (4.7) abilities in the ActiveX Control for re-projecting a Point, Shape or Shapefile if one is using VBA?   Would 4.8 offer more capability?  Am I missing something painfully obvious?

Thanks in advance.  Sorry to wait until I had a problem to post-- this is a solid product, and I've been very pleased on how much it does offer.

 

 

Jul 11, 2011 at 7:33 PM

I guess I've also just thought of another workaround, although it is a bit late for the current set of shapefiles I've built up, but that would be to process the initial shapefiles prior to re-projecting them, and add the lat and lon values as attributes.

Jul 13, 2011 at 1:34 PM

Hi John,

Welcome to the MapWindow community.

We're still working on finalizing v4.8, but I would recommend you upgrade soon.

In a few weeks projections will be added to the ocx, meaning you can reproject in your Excel application using just the ocx.

What you can do in your case is create two shapefiles in different projections and both having just on ID field.
This ID field corresponds with your data in an Excel sheet. Using the Select option of the ocx you can let an user select a shape (point, line, polygon) get the ID and show the data from the Excel sheet.
Using ogr2ogr.exe (part of the GDAL/OGR library the ocx is using) you should be able to convert the shapefile to KML as well without using Shape2Earth. Or you keep the base data as shapefile in Lambert and keep the KML in Google Projection.

BTW. You're speaking of converting to WGS84 for use in Google Maps/Earth. But I believe Google is using a slightly different projection.

Jul 13, 2011 at 2:55 PM

Paul (and the rest of you)

Thanks for the suggestions. I’ve adopted a temporary solution much like you’ve said, where I’ve reprojected the shapefiles to a geographic projection using the MapWinow app, and removed all of the unnecessary attribute. , Porting to KML is working fine for now. I’ll double-check that I’m using the right datum for Google Earth. The initial plots have been okay for county data, but I’m getting some weird artifcats by states, and I understand KML has addition restrictions on how points are ordered.

I look forward to playing with 4.8—particularly if there is more support for the GDAL libraries. I was playing with grids in 4.7, and found some parts not yet implemented. I wanted to stabilize on a 4.7 baseline first, but I may revisit that decision.

The basic strategy of associations between shapes and Excel rows I’m using, along with some graphs, plots, etc. This is a big problem for a lot of our government agencies in the US— people just don’t know enough to associate report data with features. Also, shapefiles tend to gather too many attributes over time, and get stale. So I wanted to allow a more dynamic approach that will be easy enough for a novice to user. —how much I do in Excel and how much using the DBF api is yet to be determined. I’m also supporting some selection of features by other regions, and some other features to help GIS novices to work with the data, make selections, and export it in a format they are comfortable with.

I look forward to following more discussions, and actually contributing in the future, if I uncover anything that may be of use to you all.

John Page

From: pmeems [email removed]
Sent: Wednesday, July 13, 2011 8:35 AM
To: John Page
Subject: Re: Current state of Reprojection ActiveX Control [mapwingis:264705]

From: pmeems

Hi John,

Welcome to the MapWindow community.

We're still working on finalizing v4.8, but I would recommend you upgrade soon.

In a few weeks projections will be added to the ocx, meaning you can reproject in your Excel application using just the ocx.

What you can do in your case is create two shapefiles in different projections and both having just on ID field.
This ID field corresponds with your data in an Excel sheet. Using the Select option of the ocx you can let an user select a shape (point, line, polygon) get the ID and show the data from the Excel sheet.
Using ogr2ogr.exe (part of the GDAL/OGR library the ocx is using) you should be able to convert the shapefile to KML as well without using Shape2Earth. Or you keep the base data as shapefile in Lambert and keep the KML in Google Projection.

BTW. You're speaking of converting to WGS84 for use in Google Maps/Earth. But I believe Google is using a slightly different projection.

Jul 13, 2011 at 3:01 PM

FWIW, Google Earth does use WGS84. One less thing to worry about.

http://earth.google.com/support/bin/static.py?page=guide.cs&guide=22373&topic=23750&answer=148112

From: pmeems [email removed]
Sent: Wednesday, July 13, 2011 8:35 AM
To: John Page
Subject: Re: Current state of Reprojection ActiveX Control [mapwingis:264705]

From: pmeems

Hi John,

Welcome to the MapWindow community.

We're still working on finalizing v4.8, but I would recommend you upgrade soon.

In a few weeks projections will be added to the ocx, meaning you can reproject in your Excel application using just the ocx.

What you can do in your case is create two shapefiles in different projections and both having just on ID field.
This ID field corresponds with your data in an Excel sheet. Using the Select option of the ocx you can let an user select a shape (point, line, polygon) get the ID and show the data from the Excel sheet.
Using ogr2ogr.exe (part of the GDAL/OGR library the ocx is using) you should be able to convert the shapefile to KML as well without using Shape2Earth. Or you keep the base data as shapefile in Lambert and keep the KML in Google Projection.

BTW. You're speaking of converting to WGS84 for use in Google Maps/Earth. But I believe Google is using a slightly different projection.