[mapguide-users] Feature Source and Repositories with PRJ files

Paul Spencer pagameba at gmail.com
Wed Feb 21 14:50:26 EST 2007


You can also manually provide a coordinate system wkt for feature  
sources that have no projection by saving the feature source as xml,  
inserting the appropriate XML, and then putting the XML back into the  
repository.  You can use Studio to save a resource as xml but you  
can't take an xml doc and upload it ... for that, you need to use the  
mapagent SETRESOURCE operation directly (through the /mapguide/ 
mapagent/ interface is good).

The actual XML that you need to insert looks like this:

  <SupplementalSpatialContextInfo>
     <Name>LL84</Name>
     <CoordinateSystem>PROJCS["CANA83-3TM114",GEOGCS 
["CANA83-3TM114",DATUM["NAD 83",SPHEROID["GRS 80", 
6378137,298.25722210089],TOWGS84[0,0,0,0,0,0,0]],PRIMEM["Greenwich", 
0],UNIT["Degrees", 0.0174532925199433]],PROJECTION["Transverse  
Mercator"],PARAMETER["central_meridian", -114],PARAMETER 
["latitude_of_origin", 0],PARAMETER["scale_factor", 0.9999],PARAMETER 
["false_easting", 0],PARAMETER["false_northing", 0],UNIT["Meter", 1]] 
</CoordinateSystem>
   </SupplementalSpatialContextInfo>

Note that this will only work for feature sources with no projection  
at this time.  There is an RFC (http://trac.osgeo.org/mapguide/wiki/ 
MapGuideRfc6) to modify the default behaviour to allow this to  
override the projection as well.

Cheers

Paul

On 21-Feb-07, at 1:14 PM, Dave Wilson wrote:

> The prj needs to exist at the time of the load, or the user has to  
> specify a coordinate system and the server is supposed to create  
> a .prj. However a bug exists when importing SHP natively that it  
> may not create the .prj file.
>
> If importing and converting to SDF when no .prj file exists the  
> user specified coordinate system will get set. Otherwise you will  
> have to manually create a .prj file manually and upload it again.
>
> If you don't know how to create the .prj.you can create one yourself.
>
> Import the SHP and convert to SDF. Specify the coordinate system on  
> import.
>
> Using the Web Tier pages http://servername/mapguide/mapagent/ 
> index.html you can extract the WKT string by executing a  
> GetSpatialContexts from the Feature Service list. You need to  
> specify the full repository path to the SDF you uploaded: Library:// 
> foldera/folderb/yourdata.FeatureSource
>
> Place the WKT string in a file and call it .prj
>
> I believe that should work.
>
> Regards,
> Dave
>
> From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users- 
> bounces at lists.osgeo.org] On Behalf Of Scott Hameister
> Sent: Wednesday, February 21, 2007 10:24 AM
> To: 'MapGuide Users Mail List'
> Subject: [mapguide-users] Feature Source and Repositories with PRJ  
> files
>
> Curious…I found I didn’t have some PRJ files associated with SHP  
> files that I brought in to Author through a load Procedure (Since  
> Deleted)…
>
>
>
> …I wrongly assumed I could go into my C:\Program Files 
> \MapGuideOpenSource\Server\Repositories\Library\DataFiles 
> \6b6e347e-0000-1000-8000-00c09ffd5d3f folder for that resource and  
> just drop the appropriately named prj file in…but that didn’t fix  
> the projection problem…
>
>
>
> I noticed that in Author under that SHP feature source the Prj file  
> isn’t in the list and there is no way to add it…Is there a way to  
> fix this in Author or do I have to put the PRJ file back with the  
> original SHP file and recreate a load procedure just for that layer?
>
>
>
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users

+-----------------------------------------------------------------+
|Paul Spencer                          pspencer at dmsolutions.ca    |
+-----------------------------------------------------------------+
|Chief Technology Officer                                         |
|DM Solutions Group Inc                http://www.dmsolutions.ca/ |
+-----------------------------------------------------------------+






More information about the mapguide-users mailing list