Re: [mapguide-users] SQL 2008, MGOS 2.0.2, FDO 3.3.x - 3.4.x, Maestro 1.0.9 do not cooperate
Maybe follow link can help you. http://n2.nabble.com/Maestro%3A-can%27t-find-the-table-containing-the-geometry-field-with-SQLServerSpatial-td1818596.html#a1818607 miansi wrote: Hello, I am newbe in this area and I am trying to marry SQL 2008 with MGOS. I used this topic to do transfer from SHP to SQL http://www.longhorncorner.com/UploadFile/nschan/Shapefiles04112007005648AM/Shapefiles.aspx Last Friday everything was fine and I was able to see my data on the map. Then something happens :-) and I wasn't able to see data from SQL on the map anymore. To eliminate environment-related issues I started from scratch and installed new MGOS 2.0.2 server and the story begins... The way I was changing FDO was stop MapGuide Server service, delete everything from C:\Program Files\MapGuideOpenSource2.0\Server\Bin\FDO and replace it with files from fdosdk-win32-3.3.1\Bin or fdosdk-win32-3.3.2\Bin and so on. So I was using Windows SDK files. Using FDO 3.4.0.Beta1 through FDO 3.3.2 allows me to create DataSource, which points to my SQL Server database, but gives me Failed to read schema from data source. The operation gave the error message: Bad document when I am trying to choose Feature Source while creating layer in MapGuide Maestro (both v1.0.9 and r3558). Out of the box. Using FDO 3.3.1 allows me to create DataSource and Layer, but shows no data on the map even though I know that there is data in the table and I can see it on the Spatial Results tab in the SQL. I check that my Initial Map View set to the right values. Next step for me would be to try installing Autodesk MapGuide Studio trial and using FDO SQL 2008 spatial provider from there... But before I would do so I have a question. Is there checklist of components/requirements defined and tested for MGOS - SQL 2008 integration? Like 1. PK in the table has to be int/bigint/... 2. Geometry column has to have a clustered index 3. FDO has to be version ... 4. Maestro ... Any help would be greatly appreciated. Thank you! - Regards, Carl SHE -- View this message in context: http://n2.nabble.com/SQL-2008%2C-MGOS-2.0.2%2C-FDO-3.3.x---3.4.x%2C-Maestro-1.0.9-do-not-cooperate-tp2247138p2253780.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Legend and runtime Layer filter
Hi, thanks for the answer. The bug is about 1.2 version of mapguide but i work with 2.0.2 version. Regards, Matteo Kenneth Skovhede, GEOGRAF A/S wrote: That is unfortunately a long standing bug: http://trac.osgeo.org/mapguide/ticket/167 You must manually itterate all layers in the layerdefinition, and add the information to the runtime map after startup. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi All, I have some Layer Groups that are hidden when Map is load. When I active the layer group I apply a filter runtime (change the layerdefinition of the layers) to the Layers of group, set the legend visibility of group at true, and refresh the map. I see the objects in the map but I don't see the group in the legend. If I don't set a filter to the layers I see the group in the legend. Why? Can you help me? Thanks Matteo ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/Legend-and-runtime-Layer-filter-tp2249502p2254063.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Legend and runtime Layer filter
Yes, but since the bug is not yet fixed, it is also present in 2.0.2. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi, thanks for the answer. The bug is about 1.2 version of mapguide but i work with 2.0.2 version. Regards, Matteo Kenneth Skovhede, GEOGRAF A/S wrote: That is unfortunately a long standing bug: http://trac.osgeo.org/mapguide/ticket/167 You must manually itterate all layers in the layerdefinition, and add the information to the runtime map after startup. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi All, I have some Layer Groups that are hidden when Map is load. When I active the layer group I apply a filter runtime (change the layerdefinition of the layers) to the Layers of group, set the legend visibility of group at true, and refresh the map. I see the objects in the map but I don't see the group in the legend. If I don't set a filter to the layers I see the group in the legend. Why? Can you help me? Thanks Matteo ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] SQL 2008, MGOS 2.0.2, FDO 3.3.x - 3.4.x, Maestro 1.0.9 do not cooperate
Kenneth, Yet another time I uninstall all MG-related components and install: 1. MgServerSetup-2.0.2.3011.exe 2. MgWebServerExtensionsSetup-2.0.2.3011.exe 3. Copied OSGeo.FDO.Providers.SQLServerSpatial.Overrides.dll, SQLServerSpatialOverrides.dll, SQLServerSpatialProvider.dll from fdosdk-win32-3.3.2 4. Updated providers.xml to include SQL Spatial FeatureProvider in the list. Thank you for pointing me to the log file location. Errors looks like this: - MgMappingUtil.StylizeLayers line 786 file d:\build\mapguide_open_source_v2.0\build_30.11\mgdev\server\src\services\mapping\MappingUtil.cpp Failed to stylize layer: MY_TABLE An unclassified exception occurred. 2009-02-01T14:58:00 Ajax Viewer 10.34.32.118Administrator Error: Failed to stylize layer: LAYER_FROM_VIEW An exception occurred in FDO component. RDBMS: Incompatible column type Further investigation confirmed that FDO don't like uniquieidentifier data type. Unchecking this column in the Properties available in viewer on layer tab resolved the issue - I was able to see layer on the map! I didn't test same steps on FDO 3.4.x. Thank you! Kenneth Skovhede, GEOGRAF A/S wrote: Studio does not yet support the MSSQL server provider directly, so you will get a generic page, which is not likely to solve your problem. Instead, try looking at the error log: C:\Program Files\MapGuideOpenSource2.0\Server\Logs\Error.log ... -- View this message in context: http://n2.nabble.com/SQL-2008%2C-MGOS-2.0.2%2C-FDO-3.3.x---3.4.x%2C-Maestro-1.0.9-do-not-cooperate-tp2247138p2255456.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Legend and runtime Layer filter
Kenneth, if your suggested cpp patch works, can you upload a diff? z On Mon, Feb 2, 2009 at 4:36 AM, Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk wrote: Yes, but since the bug is not yet fixed, it is also present in 2.0.2. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi, thanks for the answer. The bug is about 1.2 version of mapguide but i work with 2.0.2 version. Regards, Matteo Kenneth Skovhede, GEOGRAF A/S wrote: That is unfortunately a long standing bug: http://trac.osgeo.org/mapguide/ticket/167 You must manually itterate all layers in the layerdefinition, and add the information to the runtime map after startup. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi All, I have some Layer Groups that are hidden when Map is load. When I active the layer group I apply a filter runtime (change the layerdefinition of the layers) to the Layers of group, set the legend visibility of group at true, and refresh the map. I see the objects in the map but I don't see the group in the legend. If I don't set a filter to the layers I see the group in the legend. Why? Can you help me? Thanks Matteo ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- Zac Spitzer - http://zacster.blogspot.com +61 405 847 168 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Thematic Mapping
Hi z, Thanku very much for ur suggestions.i will respect it. but i understood the answer given by Chris. But i think its not correct solution for my original query. i want to display different colors to the different polygons. but while applying 2 colors in the InterpolateColor function it doesn't change in different colors while (dataReader.ReadNext()) { value = GetFeaturePropertyValue(dataReader, FeatId); filterText = quot; + FeatId + quot; = ; filterText = filterText + value; areaRuleXML = String.Format(areaRuleTemplate, FeatId + : + value, filterText, InterpolateColor(portion, C2C3C4, C2C3C4, 0), InterpolateColor(portion, 00, 00, 0)); areaDoc = new XmlDocument(); areaDoc.LoadXml(areaRuleXML); areaDoc.Save(C:\\theme.xml); areaNode = doc.ImportNode(areaDoc.DocumentElement, true); areaTypeStyle.AppendChild(areaNode); portion = portion + increment; } it displays some yash color to all the polygons,but i want different color to the different polygons Can u plz help me Thanks and Regards, Padmini G. zspitzer wrote: when someone takes times to provide a response, it's respectful to taking a bit more time to read your original email AGAIN ! your calling InterpolateColor(portion, C2C3C4, C2C3C4, 0), InterpolateColor(portion,C2C3C4, C2C3C4, 0)); which takes two colors to create a range, yet you pass in the same color twice sorry if I sound a bit grumpy, but it appears that Chris spent more time reading your email that you did after his reply z On Sat, Jan 31, 2009 at 7:57 PM, padmini godavarthi godavarthi.padm...@gmail.com wrote: Hi, Thanks for ur reply.but i didn't get u can u plz tell me briefly so that it will be helpful to me. Thanks and Regards, Padmini. Chris Claydon wrote: I would recommend modifying your call to InterpolateColor() so that the start color and end color correspond to the colors you want. They are currently both set to the same string. -Original Message- From: mapguide-users-boun...@lists.osgeo.org [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of padmini godavarthi Sent: Friday, January 30, 2009 3:59 AM To: mapguide-users@lists.osgeo.org Subject: [mapguide-users] Thematic Mapping Hi, iam using mpguide opensource 2.0 (.net 2.0 +IIS 5.1). I want to do thematic mapping for polygon layer(for example parcel layer) i tried to use the code in dotnetviewer sample.its working fine iam able to create a thematic layer with same color to the all polygons. Now my problem is that i want to apply different colours to the different polygons for example for parcel_id =1 green colour for example for parcel_id =2 Red colour and soon. for this can u plz tell me the code for how to do it? my code was as follows -- NameValueCollection serverVars = Request.ServerVariables; String strServerVars = ; foreach (String str in serverVars.AllKeys) { strServerVars += br + str; } String platform = serverVars[SERVER_SOFTWARE]; String queryStr = serverVars[QUERY_STRING]; string queryStr1 = serverVars[Form]; NameValueCollection requestParams = Request.HttpMethod == POST ? Request.Form : Request.QueryString; String sessionId = Request.QueryString[SESSION]; string realPath = Request.ServerVariables[APPL_PHYSICAL_PATH]; String configPath = realPath + webconfig.ini; MapGuideApi.MgInitializeWebTier(configPath); MgUserInformation userInfo = new MgUserInformation(sessionId); MgSiteConnection siteConnection = new MgSiteConnection(); siteConnection.Open(userInfo); MgResourceService resourceService = (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService); MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService); MgMap map = new MgMap(); map.Open(resourceService, mapdata); MgLayerCollection layers = map.GetLayers(); MgLayer layer = (MgLayer)layers.GetItem(property layer); MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId()); MgResourceIdentifier layerDefResId = layer.GetLayerDefinition(); MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId); // Load the Layer Definition and Navigate to the specified VectorScaleRange XmlDocument doc = new XmlDocument(); String xmlLayerDef =
Re: [mapguide-users] [ZS0] Combining features
ok thanks, this is what i have: MgPolygonCollection polygons = new MgPolygonCollection(); MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter(); MgGeometryFactory geometryFactory; while(featureReader.ReadNext()) { MgByteReader temp = featureReader.GetGeometry(GEOM); MgPolygon polygon = geometryReaderWriter.Read(temp); polygons.Add(polygon); } MgMultiPolygon newPolygon = geometryFactory.CreateMultiPolygon(polygons); MgByteReader geom = geometryReaderWriter.Write(newPolygon); but the ,MgPolygon tempPoly = geometryReaderWriter.Read(temp); part didn't work. how can i easily create a MgPolygon using MgGeometry? Kenneth Skovhede, GEOGRAF A/S wrote: Perhaps you are looking for a MultiPolygon object? http://mapguide.osgeo.net/files/mapguide/docs/webapi/d3/dc6/class_mg_multi_polygon.html For creating a MultiPolygon, look here: http://mapguide.osgeo.net/files/mapguide/docs/webapi/d4/d46/class_mg_geometry_factory_bcbcf723fb0d1e58dbd7e030ed34022f.html#bcbcf723fb0d1e58dbd7e030ed34022f If you have other objects besides polygons, you need a GeometryCollection object, but that is poorly supported IMO. Regards, Kenneth Skovhede, GEOGRAF A/S A H skrev: this should be easy, but i'm still having trouble figuring out. i have a system that allow user to draw multiple polygons, and save the polygon into a spatial database. i have this code MgFeatureQueryOptions queryStr = new MgFeatureQueryOptions(); queryStr.SetFilter(ID 0); MgFeatureReader featureReader = polyLayer.SelectFeatures(queryStr); featureReader.ReadNext(); MgByteReader geom = featureReader.GetGeometry(GEOM); MgPropertyCollection properties = new MgPropertyCollection(); properties.Add(new MgInt64Property(AREA_ID, areaID)); properties.Add(new MgStringProperty(AREA_NAME, areaName)); properties.Add(new MgGeometryProperty(GEOM_PROPERTY, geom)); but this will only get geometry of 1 of the polygons. can someone help me to modify this so that it save all the polygons into 1 new area that consist of the polygons in 'geom'? i'm thinking of something like: while(featureReader.ReadNext()) { // store the results into 1 geometry // read into MgByteReader } ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/Combining-features-tp2249387p2256710.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] [ZS0] Combining features
eep..forgot to cast it. ok thats all for now. thanks for the help. A H wrote: ok thanks, this is what i have: MgPolygonCollection polygons = new MgPolygonCollection(); MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter(); MgGeometryFactory geometryFactory = new MgGeometryFactory(); while(featureReader.ReadNext()) { MgByteReader temp = featureReader.GetGeometry(GEOM); MgPolygon polygon = (MgPolygon) geometryReaderWriter.Read(temp); polygons.Add(polygon); } MgMultiPolygon newPolygon = geometryFactory.CreateMultiPolygon(polygons); MgByteReader geom = geometryReaderWriter.Write(newPolygon); but the ,MgPolygon tempPoly = geometryReaderWriter.Read(temp); part didn't work. how can i easily create a MgPolygon using MgGeometry? Kenneth Skovhede, GEOGRAF A/S wrote: Perhaps you are looking for a MultiPolygon object? http://mapguide.osgeo.net/files/mapguide/docs/webapi/d3/dc6/class_mg_multi_polygon.html For creating a MultiPolygon, look here: http://mapguide.osgeo.net/files/mapguide/docs/webapi/d4/d46/class_mg_geometry_factory_bcbcf723fb0d1e58dbd7e030ed34022f.html#bcbcf723fb0d1e58dbd7e030ed34022f If you have other objects besides polygons, you need a GeometryCollection object, but that is poorly supported IMO. Regards, Kenneth Skovhede, GEOGRAF A/S A H skrev: this should be easy, but i'm still having trouble figuring out. i have a system that allow user to draw multiple polygons, and save the polygon into a spatial database. i have this code MgFeatureQueryOptions queryStr = new MgFeatureQueryOptions(); queryStr.SetFilter(ID 0); MgFeatureReader featureReader = polyLayer.SelectFeatures(queryStr); featureReader.ReadNext(); MgByteReader geom = featureReader.GetGeometry(GEOM); MgPropertyCollection properties = new MgPropertyCollection(); properties.Add(new MgInt64Property(AREA_ID, areaID)); properties.Add(new MgStringProperty(AREA_NAME, areaName)); properties.Add(new MgGeometryProperty(GEOM_PROPERTY, geom)); but this will only get geometry of 1 of the polygons. can someone help me to modify this so that it save all the polygons into 1 new area that consist of the polygons in 'geom'? i'm thinking of something like: while(featureReader.ReadNext()) { // store the results into 1 geometry // read into MgByteReader } ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- View this message in context: http://n2.nabble.com/Combining-features-tp2249387p2256747.html Sent from the MapGuide Users mailing list archive at Nabble.com. ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Legend and runtime Layer filter
I have created a seperate ticket with the patch, and noted this on the original ticket. Regards, Kenneth Skovhede, GEOGRAF A/S Zac Spitzer skrev: Kenneth, if your suggested cpp patch works, can you upload a diff? z On Mon, Feb 2, 2009 at 4:36 AM, Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk wrote: Yes, but since the bug is not yet fixed, it is also present in 2.0.2. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi, thanks for the answer. The bug is about 1.2 version of mapguide but i work with 2.0.2 version. Regards, Matteo Kenneth Skovhede, GEOGRAF A/S wrote: That is unfortunately a long standing bug: http://trac.osgeo.org/mapguide/ticket/167 You must manually itterate all layers in the layerdefinition, and add the information to the runtime map after startup. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi All, I have some Layer Groups that are hidden when Map is load. When I active the layer group I apply a filter runtime (change the layerdefinition of the layers) to the Layers of group, set the legend visibility of group at true, and refresh the map. I see the objects in the map but I don't see the group in the legend. If I don't set a filter to the layers I see the group in the legend. Why? Can you help me? Thanks Matteo ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users
Re: [mapguide-users] Legend and runtime Layer filter
i'm happy to test the php stuff out, i guess we will need a mgp as well? z On Mon, Feb 2, 2009 at 6:42 PM, Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk wrote: I have created a seperate ticket with the patch, and noted this on the original ticket. Regards, Kenneth Skovhede, GEOGRAF A/S Zac Spitzer skrev: Kenneth, if your suggested cpp patch works, can you upload a diff? z On Mon, Feb 2, 2009 at 4:36 AM, Kenneth Skovhede, GEOGRAF A/S k...@geograf.dk wrote: Yes, but since the bug is not yet fixed, it is also present in 2.0.2. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi, thanks for the answer. The bug is about 1.2 version of mapguide but i work with 2.0.2 version. Regards, Matteo Kenneth Skovhede, GEOGRAF A/S wrote: That is unfortunately a long standing bug: http://trac.osgeo.org/mapguide/ticket/167 You must manually itterate all layers in the layerdefinition, and add the information to the runtime map after startup. Regards, Kenneth Skovhede, GEOGRAF A/S Matteo skrev: Hi All, I have some Layer Groups that are hidden when Map is load. When I active the layer group I apply a filter runtime (change the layerdefinition of the layers) to the Layers of group, set the legend visibility of group at true, and refresh the map. I see the objects in the map but I don't see the group in the legend. If I don't set a filter to the layers I see the group in the legend. Why? Can you help me? Thanks Matteo ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users -- Zac Spitzer - http://zacster.blogspot.com +61 405 847 168 ___ mapguide-users mailing list mapguide-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapguide-users