[mapguide-users] Unable to select polygon?!?

Kori Maleski kori.maleski at gmail.com
Tue Mar 31 12:18:13 EDT 2009


Ivan,

When I view the Polygons in Autocad Map - there is a an issue with the left
polygon:

It is not 'closed' properly.  When you select the right polygon it is
entirely highlighted.  When you select the left polygon, the left boundary
segement does not highlight (since it is not there).

You may have to add the starting coordinate to close it:

coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));
coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y + 50));
coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y - 50));
coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y - 50));
coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));

Cheers,


2009/3/31 Ivan Milicevic <Ivan.Milicevic at supranet.hr>

>  Hello,
>
>
>
> I have strange problem :)
>
>
>
> -2 polygon features in SDF file (left and right) -I can not select left
> feature -I can select right feature
>
>
>
> In Map 3D 2010 everything looks ok. In FDO Tools, SDF looks just fine. The
> difference between those features is that left one is created from web code
> and right one is created from Map 3D.
>
>
>
> Any idea?
>
>
>
> The link below is link to sdf file:
>
> http://www.supranet.hr/downloads/sdf.zip
>
>
>
> and down there is code that I used to create polygon:
>
>
>
> .......main function......
>
> {
>
> //adding coord to MgCoordinateCollection
>
> coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y + 50));
>
> coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y + 50));
>
> coords.Add(geometryFactory.CreateCoordinateXY(x + 50, y - 50));
>
> coords.Add(geometryFactory.CreateCoordinateXY(x - 50, y - 50));
>
>
>
> //creating polygon
>
> MgPolygon polyObjekt = createPolygon();
>
> byteReader = agfReaderWriter.Write(polyObjekt);
>
>
>
> //defining properties in MgPropertyCollection
>
> fillProperties(id, napomena, naziv, oznaka, 1, byteReader);
>
>
>
> //inserting in SDF
>
> insertOnMap();
>
> }
>
>
>
> public MgPolygon createPolygon()
>
> {
>
> MgLinearRing mgRing = geometryFactory.CreateLinearRing(coords);
>
> MgLinearRingCollection mgRingCollection = new MgLinearRingCollection();
>
> mgRingCollection.Add(mgRing);
>
>
>
> MgPolygon mgPoly = geometryFactory.CreatePolygon(mgRing, null);
>
> return mgPoly;
>
> }
>
>
>
> public void fillProperties(Int32 ID, string napomena, string naziv, string
> oznaka, Int32 vrstaObjekta, MgByteReader bReader)
>
> {
>
> properties.Clear();
>
> properties.Add(new MgInt32Property("ID", ID));
>
> properties.Add(new MgStringProperty("NAPOMENA", napomena));
>
> properties.Add(new MgStringProperty("NAZIV", naziv));
>
> properties.Add(new MgStringProperty("OZNAKA", oznaka));
>
> properties.Add(new MgInt32Property("VRSTAOBJEKTA", vrstaObjekta));
>
> properties.Add(new MgGeometryProperty("Geom", bReader));
>
> }
>
>
>
> public void insertOnMap()
>
> {
>
> MgSiteConnection siteConnection = null;
>
> MgUserInformation userInfo = new MgUserInformation(mgSessionId);
>
> siteConnection = new MgSiteConnection();
>
> siteConnection.Open(userInfo);
>
> MgResourceService resourceService =
> siteConnection.CreateService(MgServiceType.ResourceService) as
> MgResourceService;
>
> MgFeatureService featureService =
> siteConnection.CreateService(MgServiceType.FeatureService) as
> MgFeatureService;
>
> MgResourceIdentifier resId = new
> MgResourceIdentifier("Library://PROJEKTI/ZLZ/PODACI/OBJEKTI.FeatureSource");
>
> MgFeatureCommandCollection commands = new MgFeatureCommandCollection();
>
> string layerClassName = "OBJEKTI";
>
> MgInsertFeatures mgInsert = new MgInsertFeatures(layerClassName,
> properties);
>
> commands.Add(mgInsert);
>
> featureService.UpdateFeatures(resId, commands, false);
>
> }"
>
>
>
>
>
> *Ivan Miličević*
>
> *voditelj odjela razvoja*
>
>
>
> *SUPRA NET d.o.o.
> **Majstorska 5, 10000 Zagreb
> CROATIA
>
> Mobile: +385 (0)91 434-3940
> Office: +385 (0)1 434-3940
> Fax: +385 (0)1 434-3999
> Email: ivan.milicevic at supranet.hr*
>
> *URL: www.supranet.hr*
>
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090331/c2f51bc6/attachment.html


More information about the mapguide-users mailing list