Hi all,
it's weeks that I'm searching and try solutions proposed by many forums without find a way.
What I would like to do is allow the edits of my data (shape, table, etc) on line, by allowed user.
I've found a lesson that I attach, but I didn't understand very well how write the script, even to delete a simple feature.
I've read about GeoRest and his potential, very good, but I don't understand how use GeoRest to modify my features, and not only the features samples of Sheybogan.
http://code.google.com/p/georest/
Someone could help me in sonmeway?
I'm not very good in scripting.
Anyway, it's possible that with MGE2011, a licensed product that I've payed (or, better, my society have payed) it's not possible to manage this IMPORTANT tool?
Thanks very much for your attention and yours precious suggests.
Regards
The problem that now I have is insert a point in a existing feature source loaded into a map.
I've look in a lot of manuals and discussions, principally:
1-http://www.osgeo.org/files/mapguide/docs/webapi/d1/d60/class_mg_point.htm
2-http://svn.osgeo.org/mapguide/trunk/MgDev/Common/Geometry/AgfReaderWriter.h
3-http://augiru.augi.com/content/library/au07/data/paper/DE205-3.pdf
4-http://www.osgeo.org/pipermail/mapguide-users/2007-September/009023.html
But I'm not able to achieve that and I don't understand where is the problem.
Premises:
-the feature where I want to insert the new element came from a shpfile and it's stored inside the server, and is writable. The name of the layer is ""pti_23032"" and has 2 fields obligatory to modify: "Geometry" and "FeatId";
-I launch the script directly from the taskpane of my Ajax layout;
-I have access to the map as Administrator;
-I use MGE2011 in php/java
This is the code that I'm using to try to insert a "static" point to the map. It doesn't give me any error, but it doesn't create the point too! I attach it.
Thanks in advance for your help.
(I write here the "core" part of my code):
//Specify the property values
MgPropertyCollection properties = new MgPropertyCollection();
MgAgfReaderWriter agfWriter = new MgAgfReaderWriter();
//Proviamo a creare il punto acquisendo le coordinate:
MgGeometryFactory geoFactory = new MgGeometryFactory();
double x = Double.parseDouble(coods[0]);
double y = Double.parseDouble(coods[1]);
MgCoordinate coordinate = geoFactory.CreateCoordinateXY(x, y);
MgPoint point = geoFactory.CreatePoint(coordinate);
//Proviamo con queste righe prese dal forum salvato sul desktop...niente:
MgWktReaderWriter wktReaderWriter = new MgWktReaderWriter();
String pointstring = "POINT XY (" + Double.toString(x) + " " + Double.toString(y) + ")";
MgGeometry geometry = (MgPoint) wktReaderWriter.Read(pointstring);
MgByteReader geometryByteReader = agfWriter.Write(geometry);
properties.Add(new MgGeometryProperty("Geometry", geometryByteReader));
properties.Add(new MgInt32Property("FeatId", 6));
MgInsertFeatures insertFeature1 = new MgInsertFeatures(layername, properties);
MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
commands.Add(insertFeature1);
//Per eseguire il comando--In realtà non serve ad un cazzo questa variabile "layer"...:
MgLayer layer = (MgLayer)map.GetLayers().GetItem(layername);
featureService.UpdateFeatures(fdo, commands, false);