[mapguide-users] Writing data to a shapefile example?

Andy Morsell amorsell at spatialgis.com
Mon Apr 28 15:22:15 EDT 2008


I somewhat mis-spoke in my last email.  We found that this could not be done
with the MapGuide Open API and instead required the use of the FDO API.
Whereas, for SDF files, you can use the MGOS resource and feature service
API's to accomplish everything you would need to.  This is done using
MgFeatureService::CreateFeatureSource but only supports SDF.

http://mapguide.osgeo.org/files/mapguide/docs/webapi/d5/d10/class_mg_feature
_service_8401551df70ab47d9c107985b9f5283f.htm#8401551df70ab47d9c107985b9f528
3f


Andy 

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Greg Boone
Sent: Monday, April 28, 2008 11:44 AM
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] Writing data to a shapefile example?

Using the FDO API directly, it should be possible to create and modify shape
files.

Initial creation of Shape files can be accomplished by running the FDO
ApplySchema command after connecting to an empty directory location. Each
new FDO class definition will be used to generate an empty Shape file with
the same name as the class.

Modifying Shape files can also be accomplished by running the FDO
ApplySchema command on a set of shape files that have been initially read by
specifying their directory location through the FDO Shape provider
connection properties. There is a restriction here that the shape files
being modified through ApplySchema cannot have data in them, and must be
empty.

Refer to
https://svn.osgeo.org/fdo/trunk/Providers/SHP/Src/UnitTest/SchemaTests.cpp
for examples of how this is done.

Greg

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Andy Morsell
Sent: Monday, April 28, 2008 2:22 PM
To: 'MapGuide Users Mail List'
Subject: RE: [mapguide-users] Writing data to a shapefile example?

We researched this awhile back for a project and found parts of  it not to
be possible with the existing FDO API functionality.  The biggest problems:
you cannot create a new Shape file programmatically, and you cannot modify
an existing Shape files schema.  It may be possible to have empty dummy
Shape files in the repository with the proper schema definition and then
write data into them, then copy the shape file, etc., however.

It also may be possible to modify existing Shape files, but I have not seen
any examples where this is done.  The General Tasks Shareable Markups
example is good for SDF creation and modification though.
http://data.mapguide.com/mapguide/gt/index.php


Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of MMicallef-MTO
Sent: Monday, April 28, 2008 9:22 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] Writing data to a shapefile example?


Looking for some quick help:

Does anyone have an example for generic code for writing data to a shapefile
         eg - new point with attributes
             - deleting a point
             - updating attributes

I have been looking and am unable to locate examples for 2.0 I have to put
together a site that shows this functionality for our data an do not have
much time...

Something simple - any help is greatly appreciated!

Mike
--
View this message in context:
http://www.nabble.com/Writing-data-to-a-shapefile-example--tp16942559p169425
59.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




More information about the mapguide-users mailing list