Tuesday, 25 November 2014

dynamic feature labels not always displayed

We noticed that dynamic labels for FDO features are not always displayed. Depending on other map features (points and text) dynamic labels are generated or not. Here is one example: the blue text is a dynamically generated label for a grid cell:

dynamic label in centre of map.....
If the map extent is slightly different or additional layers are turned on the dynamic label disappears:
...disappears when other layers become visible

Unfortunately there is no "switch" to force AIMS to generate the label nonetheless. But Autodesk support kindly provided a more detailed explanation about what is going on and how to get around it:

"AIMS/Map: labels are not visible if point feature or other labels are at the same place
You miss labels coming from FDO Feature stylisation
 
Cause 
In general labels are visible always on top of the graphical objects, but labels are not visible if point features are at the same place
  
Solution 
As a workaround you can change the following settings in the .layer file of Map 3D or in the .xml of AIMS
• Save the FDO layer for point features class as .layer file
• Open the .layer file with notepad(++)
• Change following setting in the .layer file from True to False
                    <AddToExclusionRegion>false</AddToExclusionRegion>"


Map 2013, SP2

Thursday, 20 November 2014

AIMS / MapGuide - scripts for map maintenance

I have written a small script which helps with "map maintenance". We have 50+ maps - nearly all of them derived from a map template. From time to time we need to add new layers to our maps - a quite awkward and time consuming process with MapGuide Studio. The script allows to insert layers and groups into all maps. Drawing order of layers and position of the group in the legend tree can be controlled (by referencing an existing layer or group). I have used the script a couple of times now it seems to work well. The script is far from being perfect - despite it might be helpful to others.
If you are interested let me know - I do not want to provide the scripts as simple download (yet) as it is "work in progress" and text/comments/variable names 
are in German only. I'm interested in collaborating with anyone else out there wanting to improve MapGuide maintenance through scripting (PHP). Just drop me a line: robert.fritz - at - win.ch

Wednesday, 19 November 2014

MapGuide / AIMS performance

Most of the data we publish to our intranet web gis (based on AIMS 2013) comes from Oracle via FDO Topobase provider. For performance reasons we have created an SDF file for the most often used base data - containing 30+ tables and 700'000 features. To my surprise the SDF file is not as fast as I expected. By changing the default value "DataConnectionPoolExcludedProviders" performance increased noticable.

By default SDF files are excldued from ConnectionPooling:
 
DataConnectionPoolExcludedProviders = OSGeo.SDF,OSGeo.SHP

By uncommenting the line and restarting AIMS things got better:

#DataConnectionPoolExcludedProviders = OSGeo.SDF,OSGeo.SHP

This has been mentioned before - but somehow I didn't know it. Here is an older reference:

http://zacster.blogspot.ch/2008/10/mapguide-performance-tips.html


In the next few days I will look into SQLite files as an alternative to SDF. A first test seems to be promising - SQLite file was much faster than SDF.

Map 2013, SP2

Monday, 17 November 2014

ORA-28031 maximum of 148 roles exceeded.

For some features in Map-Administrator (such as deleting an industry model) you need to log in with an Oracle user who has elevated privileges (DBA) compared to MAPSYS. We do not use Oracles SYSTEM user but have one with nearly DBA privileges called GISDBA. Recently we got the following error message when trying to log in with the user GISDBA:

ORA-28031 maximum of 148 roles exceeded.

When you create "guest users" with Security Administrator multiple roles are being created and two roles per guest user are attached to GISDBA.  We have many industry models (30+) and usually we create at least two guest users per industry model (one is read only, the second one allows data manipulation - depending on the complexity of the industry model we have more then 2 guest users).

But there is a limit on how many roles can be attached to one Oracle user - and we have hit the limit. The way to get around this issue is to create a second GISDBA user and to transfer some of the roles. 

select count(granted_role) from USER_ROLE_PRIVS where granted_role like 'TB%';
COUNT(GRANTED_ROLE)
-------------------
76


The example above shows that one GISDBA user now has 76 roles attached which are related to guest users.


Map 2013, SP2

Friday, 24 October 2014

Delete geometry but keep record

When you delete a geometry (industry model) Map also deletes the database record as well. In some situations you just want to delete the geometry of a feature but keep the record. How do you do this?

in Administrator:
(1) add the Geometry/Coordinate Editor control to the form





Administrator - Form Designer - add control....

in Map:
(2) set form in Edit mode
(3) open Geometry editor (button will appear next to the Editor control)



... Map - Form - use control to delete geometry.

(4) In the Geometry Editor window you can delete - step by step - all vertices of a feature (you cannot delete the whole feature in one go). After deleting all vertices don't forget to "Update" the record to make the changes permanent.

Friday, 10 October 2014

dynamic maps in Crystal reports - transparent background

In the process of migrating from TB2 to Map we also have to migrate CR reports. A few of them include a map which is created dynamically. For creating these maps with Map/AIMS I use the GeoRest extension (the one which comes with AIMS installation). The Georest extension seems only to be able to create PNG files - including a transparent background. But there is a bug in CR 2011 - transparency is not handled properly and converted either to a black or white background (see Note:  1199393 ). In our case the background was always black - the report with the map embedded didn't look nice at all:

transparent background appears black....


My colleague found a nice work-around. We created a layer which covers the whole area relevant for reporting. The layer is put in the background and gets the colour white. A map generated via GeoRest does not have a transparent background anymore:

....background colour set to white
Map 2013, SP2

Thursday, 9 October 2014

Form filter settings and reference records gone missing.....

We experienced the loss of form filter settings and reference records. The issue kept us busy for quite some time. First one colleague reported, that form-filters he had defined in multiple industry models had gone. After setting the filters up again they went missing again. Then something similar was reported from a different colleague regarding reference records. The issues occurred in our production and our testing environment.  Initially we could not really reproduce the issues. Suddenly entries were gone. Sometimes on the same day as they had been made, sometimes a few days after. No one had an explanation and Autodesk support was as puzzled as we were. Obvious suspects such as 1-ClickMaintenance or importing forms or similar actions as a cause could be excluded right from the start.

We created a trigger on table TB_REF where reference records are kept. This way we could at least determine who did a delete in the table and when. With this information available it became clear where to look for the cause.

But first some words about our Map environment:

We have set up three MAPSYS users - each MAPSYS user is run by a different organizational unit (for security reasons one organizational unit shall not have unlimited access to the data of another unit). Each MAPSYS contains a set of distinctive industry models, for instance Mapsys1 contains the industry model for electricity, Mapsys2 contains the industry model for waste water and so on. Map users can only connect to one Mapsys - the one which belongs to their organizational unit. But users need data maintained in other Mapsys environments (the guys running the water industry model would like to see data from the waste water network as well). So we created guest users for each industry model (usually based on the read-only template in Security Admin) and imported these guest users into the other Mapsys users. In my example Mapsys1 now contains:
- electricity industry model (data user)
- waster water industry model via an imported guest user

The filter settings and reference records now go missing when you set up a new workspace (in Mapsys1) and you add a guest user (in my example waste water guest user) where the underlying data user is kept in a different MAPSYS (Mapsys2). Because the user ids of the users who created the filter settings and reference records (in Mapsys2) are not known in the Mapsys environment the project is created in (Mapsys1) the settings get deleted by Map.
But there is one exception - (public) settings made by the default "Administrator" user are kept - just because the default Administrator user is always present in a Mapsys and always has the same user-id. The settings get also deleted when a user just opens the project later in Map.

There are a couple of issues here:

(1) For some reasons the default read-only guest user template allows DELETE operations on tables TB_REF* and TB_GN_DIALOG_FILTER. By revoking the DELETE permission the problem should go away.

(2) There is some in-built functionality in Map which tries to keep data consistent and to prevent orphaned entries in "TB_" tables. But in the situation described above there aren't any orphaned entries - is just that Map doesn't recognize that the data user is kept in a different Mapsys environment and therefore no deletion should take place.


The trigger we set up in the industry model (kept in Mapsys2) logged users only able to connect with Mapsys1. They actually did not delete any records - the just opened a project containing a the guest user from Mapsys2.

Map 2013, SP2