tag:blogger.com,1999:blog-24446493268345016232024-02-21T05:37:02.731+01:00RaumpatrouilleAbout things that happened to me at work.Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.comBlogger223125tag:blogger.com,1999:blog-2444649326834501623.post-64497451492560720792022-03-15T08:24:00.002+01:002022-03-15T08:24:19.698+01:00ArcCatalog - deleted feature class reappears (Enterprise Geodatabase)<p><span style="font-family: arial;">I tried to delete Oracle views in ArcCatalog but as soons as I reconnected the feature class reappeared in ArcCatalog.</span></p><p><span style="font-family: arial;">It seems that if the view is invalid in Oracle ArcCatalog can't delete it. You need to modify the view so that it becomes valid again before deleting.</span></p><p><span style="font-family: arial;">ArcMap/ArcCatalog 10.7.1, Oracle 11g</span></p>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-67986980593350245532022-03-15T08:20:00.000+01:002022-03-15T08:20:06.688+01:00Geonis Interlis Export - ORA-24550: signal received: Unhandled exception: Code=e0434352 Flags=1 - revisted<p><span style="font-family: arial;">Coming back to a <a href="http://raumpatrouille3d.blogspot.com/2019/10/geonis-interlis-export-ora-24550-signal.html">post </a>from 2019:</span></p><p><span style="font-family: courier;">ORA-24550: signal received: Unhandled exception: Code=e0434352 Flags=1</span></p><p><span style="font-family: arial;">The message doesnt help that much and hides the error message generated by the application. The message seems to be part of some kind of diagnostics which is enabled by default in some circumstances in Oracle client. It can be turned off by adding the following setting to sqlnet.ora</span></p><p><span style="background-color: white; color: #555a62; font-size: 16px;"><span style="font-family: courier;">DIAG_SIGHANDLER_ENABLED=FALSE</span></span></p><p><span style="background-color: white; color: #555a62;"><span style="font-family: arial;">After turning it off I got a more helpful error stack trace:</span></span></p><p><span style="color: #555a62; font-family: courier;"><span style="font-size: 16px;">Unhandled Exception: GEONIS.Core.ErrorHandling.GTranslateableException: Could not open Table [VMG.VMG_V_VER_FLA_ART] ---> System.Runtime.InteropServices.COMException: DBMS-Tabelle nicht gefunden [ORA-24372: Ungültiges Objekt für Beschreibung]</span></span></p><p><span style="color: #555a62; font-family: courier;"><span style="font-size: 16px;"> at ESRI.ArcGIS.Geodatabase.IFeatureWorkspace.OpenTable(String Name)</span></span></p><p><span style="color: #555a62; font-family: courier;"><span style="font-size: 16px;"> ....</span></span></p><p><br /></p>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-85478611446998708472021-09-21T19:12:00.014+02:002021-09-21T19:20:07.358+02:00Hide single features in ArcMap<p>Here is a Python tool to hide selected features in ArcMap and to bring them back to screen. Useful if you need to create a screenshot / printout but want to hide certain features but not a whole layer. The tool applies a definition filter to "hide" selected features (across multiple layers) and removes the filters to display the features again. Filter condition is added to existing query.</p><p>Initial idea found on gis.stackexchange:</p><p><a href="https://gis.stackexchange.com/questions/368848/creating-definition-query-from-selected-features-using-arcgis-pro">https://gis.stackexchange.com/questions/368848/creating-definition-query-from-selected-features-using-arcgis-pro</a></p><p>First the toolbox definition - save as PYT file:</p>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f0f0f0; background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRN01mRehZ2TK38BHBRZKw4CJmAJCs7k4UwYcXvbQz9CpyTGasd58kS4VGyakR8Jd2TT-5ypH_RmEvNtZ5IcpWAjIS_FAuWeraFU-wDrdbeQnZQ0JV-kz7BIkYXkS1BSyo1UcYDTdBINj3/s320/codebg.gif); background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; overflow-wrap: normal; word-wrap: normal;"> # -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 08:49:34 2020
"""
import arcpy , m_main_layer
class Toolbox(object):
def __init__(self):
"""Define the toolbox (the name of the toolbox is the name of the .pyt file)."""
self.label = "My Toolbox"
self.alias = ""
# List of tool classes associated with this toolbox
self.tools = [FeatureOff, FeatureOn]
class FeatureOff(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Hide selected features"
self.description = "Hides selected features by applying a layer definition query"
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
return
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
reload(m_main_layer)
m_main_layer.main_off()
return
class FeatureOn(object):
def __init__(self):
"""Define the tool (tool name is the name of the class)."""
self.label = "Display hidden features"
self.description = "displays hidden features by removing layer definition query"
self.canRunInBackground = False
def getParameterInfo(self):
"""Define parameter definitions"""
return
def isLicensed(self):
"""Set whether tool is licensed to execute."""
return True
def updateParameters(self, parameters):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
return
def updateMessages(self, parameters):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
return
def execute(self, parameters, messages):
reload(m_main_layer)
m_main_layer.main_on()
return
</code></pre>
Here the main Python script:
<pre style="background-attachment: initial; background-clip: initial; background-color: #f0f0f0; background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRN01mRehZ2TK38BHBRZKw4CJmAJCs7k4UwYcXvbQz9CpyTGasd58kS4VGyakR8Jd2TT-5ypH_RmEvNtZ5IcpWAjIS_FAuWeraFU-wDrdbeQnZQ0JV-kz7BIkYXkS1BSyo1UcYDTdBINj3/s320/codebg.gif); background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; overflow-wrap: normal; word-wrap: normal;"> # -*- coding: utf-8 -*-
"""
Created on Fri Mar 20 09:11:37 2020
"""
# -*- coding: utf-8 -*-
import arcpy
# mark start of query condition
# comments such as /* -- */ do not work with FGDB
# therefore we add a dummy condition as start marker
query_start_marker = "'A'='A'"
query_concat = " AND "
# max value might be different for each database system in use:
max_num_selected_features_per_layer = 999
def remove_filter_features(lyr):
if not lyr.isFeatureLayer:
return
desc = arcpy.Describe(lyr.name)
query = lyr.definitionQuery
start = query.find(query_start_marker)
if start >= 0:
query_front = query[:start]
len_query_conact = len(query_concat)
if len(query_front) > len_query_conact and query_front[-len_query_conact:] == query_concat:
query_front = query_front[:-len_query_conact]
lyr.definitionQuery = query_front
def apply_filter_selected_features(lyr):
if not lyr.isFeatureLayer:
return
desc = arcpy.Describe(lyr.name)
if desc.FIDSet != '':
fid_list = desc.FIDSet.split(";")
if len(fid_list) > max_num_selected_features_per_layer:
arcpy.AddMessage("Too many features selected ({0}), max: {1}.".format(len(fid_list),max_num_selected_features_per_layer))
return
query = ' {} NOT IN ({}) '.format(desc.OIDFieldName, ",".join(fid_list))
existing_query = lyr.definitionQuery
if existing_query:
query = existing_query + query_concat + query_start_marker+ ' AND ' + query
else:
query = query_start_marker + ' AND ' + query
lyr.definitionQuery = query
arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")
def main_off():
arcpy.AddMessage("hide selected features....")
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for l in arcpy.mapping.ListLayers(df):
apply_filter_selected_features(l)
arcpy.AddMessage("hide selected features....finished")
def main_on():
arcpy.AddMessage("display hidden features....")
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
for l in arcpy.mapping.ListLayers(df):
remove_filter_features(l)
arcpy.RefreshActiveView()
arcpy.AddMessage("display hidden features....finished")
</code></pre><div><br /></div>
Example:<div><br /><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMJx_Ywam0k1ZCA7H0tEDOAZghtYbEuqWGOjp-cSFxJVZd81615iQ4G8Bz9dGI4Wd1h4oO3elgwdkuCZtFTBmddNydjLpzmVdIK7lDMHW235KlwvctnO8S0DPrrwkVYkthtLEZGnNzq2No/s1190/hide_step_1.png" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="667" data-original-width="1190" height="224" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMJx_Ywam0k1ZCA7H0tEDOAZghtYbEuqWGOjp-cSFxJVZd81615iQ4G8Bz9dGI4Wd1h4oO3elgwdkuCZtFTBmddNydjLpzmVdIK7lDMHW235KlwvctnO8S0DPrrwkVYkthtLEZGnNzq2No/w400-h224/hide_step_1.png" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">select features...</td></tr></tbody></table><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlbed-Y-4KWMsRga1kRbc978iYie_IdFSUcQPAVS3MWvLk5FC6SoCAe5SWno9jhVfbV4uThxLzMul4gScIcDvqHYJ6Xll55VBXfE18-6DpklTIcE-j9mjwN3pkuF7vxfxL0kF_-hL6Aqw9/s986/hide_step_2.png" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="587" data-original-width="986" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlbed-Y-4KWMsRga1kRbc978iYie_IdFSUcQPAVS3MWvLk5FC6SoCAe5SWno9jhVfbV4uThxLzMul4gScIcDvqHYJ6Xll55VBXfE18-6DpklTIcE-j9mjwN3pkuF7vxfxL0kF_-hL6Aqw9/s320/hide_step_2.png" width="320" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">...hidden...</td></tr></tbody></table><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikErIQ6Lx8eedVrO5uNN51jLadg3aFkqmcBWZIjmAxhEPVPyChpVorMLgd87XUQwVtpwwlI2jWiomR9ivUF8S0Eevko7r129riRtvpeer_pG4PUooutzVHsjNQnU__U2Jusn5zXEtfGL-x/s1229/hide_step_3.png" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="693" data-original-width="1229" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikErIQ6Lx8eedVrO5uNN51jLadg3aFkqmcBWZIjmAxhEPVPyChpVorMLgd87XUQwVtpwwlI2jWiomR9ivUF8S0Eevko7r129riRtvpeer_pG4PUooutzVHsjNQnU__U2Jusn5zXEtfGL-x/s320/hide_step_3.png" width="320" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">...bringing them back to screen...</td></tr></tbody></table><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuGwBs69xPI5HKLse8rYDfRmoWQ8tSH6MKwBzJldAeUmjhUCA18zHv1EwXmeN6KMH7_sHVmaEN8ag62seXH02d_OIUj2rI33fBeYjkcWMlBtgw9JZOfMDFi5iyS9svS5OSb7T9Y_nqxtV/s951/hide_step_4.png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="497" data-original-width="951" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhuGwBs69xPI5HKLse8rYDfRmoWQ8tSH6MKwBzJldAeUmjhUCA18zHv1EwXmeN6KMH7_sHVmaEN8ag62seXH02d_OIUj2rI33fBeYjkcWMlBtgw9JZOfMDFi5iyS9svS5OSb7T9Y_nqxtV/s320/hide_step_4.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: left;"><br /></div><br /><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><br /></div></div>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-13217159145484895352019-12-19T08:33:00.000+01:002019-12-19T08:33:02.354+01:00ArcGISServer / WebOffice - Reprojecting WMS service<span style="font-family: Arial, Helvetica, sans-serif;">It seems neither ArcGISServer nor <a href="https://www.vertigis.com/" target="_blank">VertiGIS </a>WebOffice allow reprojecting a WMS service. However, that is what we needed as the WMS service provider from across the border did not want to add support for another coordinate system (epgs:2056) to its service. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">First option we looked into was <a href="https://mapproxy.org/" target="_blank">MapProxy </a>. It's relatively easy to install and to get a basic sample up and running. But it seems integration into IIS is not straightforward. I didn't bother to invest more time investigating this option any further. Fortunately, <a href="http://geoserver.org/" target="_blank">GeoServer </a>also supports reprojecting WMS services - and surprisingly it was very easy to install and to get it to work. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">As we use VertiGIS WebOffice we have already Tomcat running. GeoServer installation is basically downloading the right file (Web-Archive), unzipping it and copying the resulting WAR file in to Tomcats WebApp folder and finally restarting Tomcat. Second step is to set up the WMS service - again straightforward as GeoServer comes with an easy to use and self-explaining web-interface.</span><br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUPYNTGpFUCq1dkO21DtD9m7LiXDqpZFZEe84-JFkJYKitg8RRN-EMN6ek3X52FEGjUTFyBPJXvCLw5ih7DEmWe8GlSidCKS2SKzJRaYWmPlqP6N9Di6MScCQIfZJeR5BPKiYVIpBb49Ku/s1600/wms_reproject.PNG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="814" data-original-width="1086" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUPYNTGpFUCq1dkO21DtD9m7LiXDqpZFZEe84-JFkJYKitg8RRN-EMN6ek3X52FEGjUTFyBPJXvCLw5ih7DEmWe8GlSidCKS2SKzJRaYWmPlqP6N9Di6MScCQIfZJeR5BPKiYVIpBb49Ku/s400/wms_reproject.PNG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Map project in epsg:2056, WMS service provided in epsg:25832 but reprojected by GeoServer</span></td></tr>
</tbody></table>
<br />Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-12139507178058132132019-10-21T12:29:00.003+02:002019-10-21T12:29:40.937+02:00Geonis form with SQL <span style="font-family: Arial, Helvetica, sans-serif;">I added the following SQL statement to a Geonis form</span><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <edit title="Objekt" width="150">
<select>
select name_nummer as name from u_ele_trasseeabschnitt where globalid = [REF_FEAT_GID]
union all
select name_nummer as name from u_ele_strangabschnitt where globalid = [REF_FEAT_GID]
union all
select name || ', ' || u_tplnr from ele_tragwerk where globalid = [REF_FEAT_GID]
union all
select name || ', ' || u_tplnr from ele_schacht where globalid = [REF_FEAT_GID]
</select>
</edit>
</code></pre>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">but I didn't get any results. Turns out that one needs to use the CONCAT command instead:</span><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <edit title="Objekt" width="150">
<select>
select name_nummer from u_ele_trasseeabschnitt where globalid = [REF_FEAT_GID]
union all
select name_nummer from u_ele_strangabschnitt where globalid = [REF_FEAT_GID]
union all
select concat(name, concat(', ', u_tplnr)) as name_nummer from ele_tragwerk where globalid = [REF_FEAT_GID]
union all
select concat(name, concat(', ', u_tplnr)) as name_nummer from ele_schacht where globalid = [REF_FEAT_GID]
</select>
</edit>
</code></pre>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Geonis 2017.0</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-35702534857699957292019-10-07T16:23:00.001+02:002019-10-07T16:23:32.748+02:00Geonis Interlis Export - ORA-24550: signal received: Unhandled exception: Code=e0434352 Flags=1When exporting Interlis/LK Map FME just stopped working. Log file didn't contain any further information about the cause.<br />
<br />
I had done an export successfully earlier with a project from the test database. Using the production database FME crashed.<br />
<br />
The only difference I noticed was that the test project used an owner-connection to Oracle, the production project a editor-connection.<br />
<br />
To get more information about the cause of the issue I ran the FME workbench in Windows command line - that's where I got the more detailed error message:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp6nCqWaBo3948cB-JnGf54O9FEseG0q21PuVQWOWsZF6twwmJxfvx6G9M9La05a3bHI1HUYw7UeenIGtvxtIPu9Di69qLhu5c3Q7xw79LF-oTZ6ElOCpuevzpzkwIZpt695mqlYstMrDR/s1600/oracle_24550.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="177" data-original-width="959" height="73" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp6nCqWaBo3948cB-JnGf54O9FEseG0q21PuVQWOWsZF6twwmJxfvx6G9M9La05a3bHI1HUYw7UeenIGtvxtIPu9Di69qLhu5c3Q7xw79LF-oTZ6ElOCpuevzpzkwIZpt695mqlYstMrDR/s400/oracle_24550.PNG" width="400" /></a></div>
<br />
<br />
I don't really know what the error message is about. But when I run the export using the owner-connection it finishes successfully.<br />
<br />
ArcMap 10.5.1, Geonis 2017.0, FME 2016, Oracle 11.2<br />
<br />Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com1tag:blogger.com,1999:blog-2444649326834501623.post-84590084567627560652019-10-04T10:57:00.002+02:002019-10-04T10:57:34.422+02:00GEONIS DB UPDATE - Umlauts not importet correctly<span style="font-family: Arial, Helvetica, sans-serif;">To import german umlauts (and other special characters) correctly into Oracle using <a href="https://geocom.ch/en/solutions/framework/geonis" target="_blank">Geonis </a>Db Update the following two requirements have to be fullfilled:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">(1) first line of XML file needs to define correct encoding:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><?xml version="1.0" encoding="utf-8"?></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">(2) XML file encoding itself needs to be UTF-8 BOM</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5E56IaRgynhb2Kv38rjpE7yqMrDdj-Sj-EW8SFVN7SINByatbTbwnY3FxK2gA2idrTX3yvEWO8DViaPBzXYAh9tupIFL9Pt96ProD2vdXbBlxh6bnvXfVgLFZOn3iIbpeydkW5NgsTeln/s1600/encoding_bom.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="309" data-original-width="282" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5E56IaRgynhb2Kv38rjpE7yqMrDdj-Sj-EW8SFVN7SINByatbTbwnY3FxK2gA2idrTX3yvEWO8DViaPBzXYAh9tupIFL9Pt96ProD2vdXbBlxh6bnvXfVgLFZOn3iIbpeydkW5NgsTeln/s1600/encoding_bom.PNG" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Geonis 2017</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-88012776753757318002019-09-16T18:49:00.001+02:002019-09-16T18:49:21.793+02:00ArcSDE Compress didn't compress<span style="font-family: Arial, Helvetica, sans-serif;">I inserted some data my means of SQL into a SDE managed table - or to be more precise into the SDE managed view belonging to the table.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I had done that before and so far it had worked without any issues. This time the compress operation didnt compress at least the table I had inserted rows. I ran compress a few times but to no avail. I restarted ArcGIS server but again it didnt change the result. Then I stopped ArcGIS server and killed all remaining connections to the Oracle schema and ran compress again. This time compress finished succesfully. Up to now I never had to kill all connections - so I assume there was something different this time.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">ArcMap 10.5.1, Oracle 11.2.0.4</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-73330700424994268892019-07-15T13:31:00.000+02:002019-07-15T13:31:33.931+02:00ArcMap – Oracle LISTAGG results in empty column<br />
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;">When using
LISTAGG recently in view definition I had the problem that the column content
based on LISTAGG was not shown in ArcMap / ArcCatalog.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "arial" , "helvetica" , sans-serif;">The LISTAGG
command usage was like that:<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "courier new" , "courier" , monospace;">…<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "courier new" , "courier" , monospace;">cast(listagg(nachname
|| '; ' || vorname || ' / ') within group(order by nachname) as nvarchar2(500))
as eigentuemer_name,<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "courier new" , "courier" , monospace;">…</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "arial" , "helvetica" , sans-serif;">The columns
(nachname, vorname) I concatenated were of data type “nvarchar2”. My initial
view definition did not specify the data type for the column – I added it later
but it did not solve my problem.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span lang="EN-US" style="mso-ansi-language: EN-US;">In SQL
Developer the content of the column was shown right from the start. To check
how other applications behave I connected to the view using Excel and tried to
import the data into a sheet. When I did that I got an </span><b><span lang="EN-US" style="background: white; color: #222222;">ORA</span></b><span lang="EN-US" style="background: white; color: #222222;">-<b>01401 inserted value too large
for column</b> message. After bit of
research I found the following <a href="https://stackoverflow.com/questions/19537234/why-am-i-getting-ora-01401-inserted-value-too-large-for-column-when-im-not-i" target="_blank">discussion</a> on SO</span><span lang="EN-US" style="background: white; color: #222222;">.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span lang="EN-US" style="background: white; color: #222222;">It was
mentioned that there might be an issue with the length of the </span><span lang="EN-US" style="background: white; color: #242729;">right hand side of the concatenation operator when usung NVARCHAR. I changed the view
definition to VARCHAR2 and also increased the size. Afterwards I could import
the data into Excel – but in ArcMap the column was still empty.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span lang="EN-US" style="background: white; color: #242729;">The second hint on the page –
applying to_char conversion - finally solved the issue:</span><span lang="EN-US" style="background: white; color: #222222;"><o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "courier new" , "courier" , monospace;">...</span></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "courier new" , "courier" , monospace;">cast(listagg(to_char(nachname)
|| '; ' || to_char(vorname) , ' / ') within group(order by nachname) as
varchar2(4000)) as eigentuemer_name,<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><o:p><span style="font-family: "courier new" , "courier" , monospace;">...</span></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "arial" , "helvetica" , sans-serif;">It’s a bit
strange – other columns in the view based on NVARCHAR2 are shown in ArcMap.
Only in connection with LISTAGG the problem occurs.<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="mso-ansi-language: EN-US;"><span style="font-family: "arial" , "helvetica" , sans-serif;">ArcMap 10.5.1,
Oracle 11.2.0.4.0</span><o:p></o:p></span></div>
<br />Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-30280727041394332632018-02-16T10:43:00.002+01:002018-02-16T10:43:59.169+01:00ArcMap slow?<span style="font-family: Arial, Helvetica, sans-serif;">ArcMap was extremly slow on my PC. Opening attribute tables, the Add Data dialog box, a model oder even a toolbox took ages (such as opening a toolbox > 30secs).</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Now, I'm used to applying "Windows Classic" design in order to speed up things.<br />Turns out - since switching back to standard Windows 7 design ArcMap performance has improved significantly on my machine! Opening a larger model now only takes 1-2 secs (if at all)!<br /><br />ArcMap 10.3, Windows 7</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-80454834771835309282018-01-17T11:50:00.000+01:002018-01-17T11:50:04.668+01:00Excel Pivot table - manually reorder rows<span style="font-family: Arial, Helvetica, sans-serif;">Header > Sort Options > manually<br /><br />Then:<br />- click into cell of row you want to move<br />- open context menu > "move"</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy1l9y9EX4ki-Gn9dr1TGedfMSkaYix2Xx2Q8hvpsuOdnQf2L42ybuzcZ1ykTy3BuG4nVMJr4coJR8a0v5Lg8LRhyphenhyphenJKsgv5cPL6w0dCtGyywbj8G_T3OkVCD6S8jR0vugcNnk_gwee5rJE/s1600/excel_move.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="499" data-original-width="458" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy1l9y9EX4ki-Gn9dr1TGedfMSkaYix2Xx2Q8hvpsuOdnQf2L42ybuzcZ1ykTy3BuG4nVMJr4coJR8a0v5Lg8LRhyphenhyphenJKsgv5cPL6w0dCtGyywbj8G_T3OkVCD6S8jR0vugcNnk_gwee5rJE/s320/excel_move.PNG" width="293" /></a></span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Excel 2013</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-12972926625425528962017-12-21T10:15:00.001+01:002017-12-21T10:15:45.732+01:00ArcPy - find layers with joins<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is a brute force script for finding layers with JOINs. As there doesn't seem to be a "hasJoin" property I just use arcpy.RemoveJoin_management which throws an exception if there is no join. This is script is only usefull for once off checks.</span><br />
<br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">ArcMap 10.3</span><br />
<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> # find (all) joins in MXD by removing them!
# usage: copy MXD and run script or run script and don't save MXD as all JOINS will be removed
# result will be a list of all layers where JOIN has been removed succesfully
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
layers = arcpy.mapping.ListLayers(mxd)
allJoins = ''
for layer in layers:
try:
arcpy.RemoveJoin_management (layer.name)
print("join removed: "+layer.name)
allJoins += '\n'+layer.name
# no join throws exception
except Exception as err:
print(err.args[0])
print(allJoins)
</code></pre>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-2810123740939255992017-12-20T12:27:00.000+01:002017-12-20T12:27:28.150+01:00ArcPy - MoveLayer fails with "assert refe_c is not None, 'Did not find reference layer.'"<span style="font-family: "arial" , "helvetica" , sans-serif;">Just wanted to copy and paste all layers into new MXD file. Unfortunately order of layers in TOC is not retained. So I googled for script and found one - but MoveLayer failed with error message "assert refe_c is not None, 'Did not find reference layer.'". The post did not mention anything like that.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Solution in my case : for the reference layer a fresh reference is required. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">old: refLayer=moveLayer</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">new: refLayer = arcpy.mapping.ListLayers(mxdT, moveLayer.name, dfT)[0]<span style="white-space: pre;"> </span> </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">ArcMap 10.3.1</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is the script:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> # -*- coding: utf-8 -*-
# source code initially taken from: https://community.esri.com/thread/28042
# assumption : no layer groups
# my use case : copy and paste all layers into new MXD, layer order is not retained - run script to restore layer order
import arcpy
mxd_source = r"C:\temp\source1.mxd"
mxd_target = r"C:\temp\target.mxd"
mxdT = arcpy.mapping.MapDocument(mxd_target)
# assumption: only one DF
dfT = arcpy.mapping.ListDataFrames(mxdT, "")[0]
mxdS = arcpy.mapping.MapDocument(mxd_source)
# assumption: only one DF
dfS = arcpy.mapping.ListDataFrames(mxdS, "")[0]
#initialize refLayer with layer
refLayer = arcpy.mapping.ListLayers(mxdT,"",dfT)[0]
for layerSource in arcpy.mapping.ListLayers(mxdS,"",dfS):
c=layerSource.longName
d=layerSource.description
sourceLayer=c+d
print("processing layer in source: '" + sourceLayer+"'.")
for layerTarget in arcpy.mapping.ListLayers(mxdT,"",dfT):
a=layerTarget.longName
b=layerTarget.description
moveLayer= a+b
if sourceLayer==moveLayer:
print("moving layer:'"+moveLayer+"', reference layer: '"+refLayer.name+"'.")
moveLayer=layerTarget
arcpy.mapping.MoveLayer(dfT,refLayer,moveLayer, "After")
#get fresh layer reference - otherwise MoveLayer will fail next time:
refLayer = arcpy.mapping.ListLayers(mxdT, moveLayer.name, dfT)[0]
break
mxdT.save()
#arcpy.RefreshActiveView()
#arcpy.RefreshTOC()
</code></pre>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-48482954997310048272017-10-19T09:53:00.002+02:002017-10-19T09:53:12.176+02:00Job available<span style="font-family: Arial, Helvetica, sans-serif;">We are currently looking for a GIS specialist. The job description can be found here:</span><br />
<br />
<a href="https://jobs.winterthur.ch/?yid=1755&sid=6k9afr49m011jjoe5rsjb72802" target="_blank"> https://jobs.winterthur.ch/?yid=1755&sid=6k9afr49m011jjoe5rsjb72802</a><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Please apply if you are interested.</span><br />
<br />
<br />Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com1tag:blogger.com,1999:blog-2444649326834501623.post-15346373103539262052017-09-12T15:54:00.001+02:002017-09-12T15:54:30.098+02:00Warning: An exception occurred in FDO component.<span style="font-family: Arial, Helvetica, sans-serif;">I got the following warning in MapGuide log file:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Warning: An exception occurred in FDO component.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Zeichenfolge ist kein gültiger Ausdruck. </span><br />
<span style="font-family: Courier New, Courier, monospace;"> StackTrace:</span><br />
<span style="font-family: Courier New, Courier, monospace;"> - MgStylizationUtil.ExceptionTrap() line 231 file SE_ExpressionBase.cpp</span><br />
<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">The message means "string is invalid expression".</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">In my case it seems the issue is related to text label style. The text label was originally published using MTEXT as style. Later on - due to a bug in MapGuide - I changed the text style to TEXT. But since I changed TEXT back to MTEXT the message doesn't appear in the log files anymore. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Autodesk Infrastructure MapServer 2017</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-4159579792019597202017-08-17T08:54:00.000+02:002017-08-17T08:54:12.569+02:00File based Industry Model - how to modify views <span style="font-family: Arial, Helvetica, sans-serif;">When you use a file based Map Industry Model (IM) you might want to extend the data model and add attributes to one of the tables. If you are not familiar with databases, SQL and the concept of "table" and "view" this blog post will explain some basic concepts behind Map IMs and also show how you can add attributes to both tables and views. </span><br />
<h2>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><span style="font-size: large;">Tables and views</span></b> </span></h2>
<span style="font-family: Arial, Helvetica, sans-serif;">AutoCAD Map comes with ready-to-use Industry Models. These IMs contain many tables, views, forms, labels and so on. Tables actually store data, views only provide a "view" on one or more tables and do not contain any data. Look here for more details: </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://en.wikipedia.org/wiki/View_(SQL)">https://en.wikipedia.org/wiki/View_(SQL)</a> </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Nothing prevents you from storing all your data in just one big table. But there are disadvantages to it and therefore data is usually split across multiple tables. Here is more information on why: </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://en.wikipedia.org/wiki/Database_normalization" target="_blank">https://en.wikipedia.org/wiki/Database_normalization </a></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">When you have data across multiple tables you need to combine data in order to get the information you need - "views" are one way to achieve that. </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">In Autodesk Infrastructure Administrator (AIA) tables and views appear the same at first glance. But if the Data Model was set up properly a view will have a display name ("caption") containing the word "view". Whenever you create a new table or attribute in AIA you need to enter a name but you can also enter a "caption" - a more descriptive name:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI6Unvmu1e7GpdNZtzjGxjn3YuoOZvX2JxOeR2mCNq04rCTDIpkeUT65CIiJgnN80a9A6A10iK3sHhjEQ-_ydOGKpDDStFl6ftwHtvDB7DUpyK-SKje3fuM_-p9PmM5NdBgfsHQXZRbhGl/s1600/02_caption.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="261" data-original-width="437" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI6Unvmu1e7GpdNZtzjGxjn3YuoOZvX2JxOeR2mCNq04rCTDIpkeUT65CIiJgnN80a9A6A10iK3sHhjEQ-_ydOGKpDDStFl6ftwHtvDB7DUpyK-SKje3fuM_-p9PmM5NdBgfsHQXZRbhGl/s320/02_caption.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Feature class name and caption </span></td></tr>
</tbody></table>
<span style="font-family: Arial, Helvetica, sans-serif;">The caption will be used in AIA and Map, not the name of the object: </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCJJ6_rr5Y7i1a0Bp6eyzV2nQTepMhI2fe9U6KjTK0zUnEK6LGMhW9VYXYrF9mm_BkMAOcjVgrJJZMrUfIyMAuUsQ1roNUynNUPVfaxRcOguwk5qyreEkqLmGBcjEHTMP9QiMBErsBSsx6/s1600/05_tables_by_caption.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="388" data-original-width="728" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCJJ6_rr5Y7i1a0Bp6eyzV2nQTepMhI2fe9U6KjTK0zUnEK6LGMhW9VYXYrF9mm_BkMAOcjVgrJJZMrUfIyMAuUsQ1roNUynNUPVfaxRcOguwk5qyreEkqLmGBcjEHTMP9QiMBErsBSsx6/s320/05_tables_by_caption.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">List of all tables/views in "Point" - column "Feature Class" shows captions</td></tr>
</tbody></table>
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Whenever you need to work directly in the database you first need to find out the name of the table/view. The names are shown in AIA as well - just look below the tree view where the caption and the name of the table/view (in brackets) are displayed: </span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL5hVRet9j-QHO7_6Tc-lT4YYCVC8ln1pfbsf9pVheJVWQfbyJqprgQ_atDkLHyGHpob5C9vWgFXY_kLIms2r7Y6CuvTo7BcNEZbqc3LMAOMjgkbbfrjp-nKy__ztd-yWvsvlYHqDxfKeE/s1600/03_feature_class_name.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="708" data-original-width="734" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL5hVRet9j-QHO7_6Tc-lT4YYCVC8ln1pfbsf9pVheJVWQfbyJqprgQ_atDkLHyGHpob5C9vWgFXY_kLIms2r7Y6CuvTo7BcNEZbqc3LMAOMjgkbbfrjp-nKy__ztd-yWvsvlYHqDxfKeE/s320/03_feature_class_name.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">For a selected item the name and caption is shown in the status bar below the Data model tree view.</span></td></tr>
</tbody></table>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">You will also notice another convention - in a databases a view name often contains "_v_" to indicate that it is a view and not a table. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Example: in WA Industry Model there is a table called: "Fitting" (see screenshot above):</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">"</span><span style="font-family: Courier New, Courier, monospace;">Fitting</span><span style="font-family: Arial, Helvetica, sans-serif;">" - display name for table "WA_FITTING" shown in AIA and Map </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">"</span><span style="font-family: Courier New, Courier, monospace;">WA_FITTING</span><span style="font-family: Arial, Helvetica, sans-serif;">" - name of the table in the database (WA indicating that the table belongs to the WA Industry Model) </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">"</span><span style="font-family: Courier New, Courier, monospace;">Fitting View</span><span style="font-family: Arial, Helvetica, sans-serif;">" - display name for view "WA_V_FITTING" shown in AIA and Map </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">"</span><span style="font-family: Courier New, Courier, monospace;">WA_V_FITTING</span><span style="font-family: Arial, Helvetica, sans-serif;">" - name of the view in the database </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">In AIA you can easily add attributes to a table. If you add an attribute you usually want to have the attribute shown on your form as well in order to be able to enter data. So you need to open the form for the table in AIA Form Designer and add the new attribute there as well. In case the new attribute is also needed to style features in your drawing you need to incorporate it in your layer definition. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">But layers in Display Models often are based on views and not on tables. In this case adding an attribute to a table is not sufficient - the attribute also needs to be added to the view in question. Now, here is a limitation of AIA - you cannot create or modify an existing view the same way you can create or modify a table. For a view the context menu function "Add attribute" is not available: </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"> <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghM83ejfI1neSuKlqwJ4Su8YFazmkPAL3jHibmVyCizG8ZEJVz7J9JvgBIVIxqRi1auJfXOWE4V1tBtClJ1TD_TS5NG3OfVU8O-xBWE18ZuY78CMHemM8ZnLPU1WWnE2q19N3qxcR47Kkp/s1600/02_add_attribute_view.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="517" data-original-width="714" height="231" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghM83ejfI1neSuKlqwJ4Su8YFazmkPAL3jHibmVyCizG8ZEJVz7J9JvgBIVIxqRi1auJfXOWE4V1tBtClJ1TD_TS5NG3OfVU8O-xBWE18ZuY78CMHemM8ZnLPU1WWnE2q19N3qxcR47Kkp/s320/02_add_attribute_view.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">For a view "Add Attribute" is not available</td></tr>
</tbody></table>
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">In order to do that you need to use a tool called "SQL Sheet" which comes with AIA - we will come to that in a second.</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">How do you know whether a layer in Display Model is based on a table or on view? </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">After generating graphics using the Display Model in question you can check either by hovering the mouse on top of the layer name in Display Manager - a flyout will show the layer's data source (table/view name, not the caption) - </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYWGqXHvvJDuEGkQVs4CdQE_BBTzPCJ_xBr-0WXkfNs-QrRpL-oZ8vhG-wY42yfJgp3g5CfSCf-VneKP6ACJs8XEof1MWgGk8nedXkkYaG5R0u-PuNN4tkYz1Xm2KjU48ZL-Howf2UyxJs/s1600/04_datasourcename.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="175" data-original-width="411" height="136" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYWGqXHvvJDuEGkQVs4CdQE_BBTzPCJ_xBr-0WXkfNs-QrRpL-oZ8vhG-wY42yfJgp3g5CfSCf-VneKP6ACJs8XEof1MWgGk8nedXkkYaG5R0u-PuNN4tkYz1Xm2KjU48ZL-Howf2UyxJs/s320/04_datasourcename.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Layer data source name is shown in fly out for layer in Display Manager</span></td></tr>
</tbody></table>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">or open the StyleEditor for the layer and the table/view name is displayed there as well on the top: <table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH01_mDGlqa7Nk2l7RMwU2WZ1j2DP4zz9LfzCdJKs1q94PDmHVzhNFLXzI61R7IDz8z12_yvFeHxHC76X7EpQWvfiZ-5c0Gco67AuXdiHyG5Y7T8lcIi2X2I06Vgagso_7BGMfZXDAfrsz/s1600/05_datasourcename.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="160" data-original-width="481" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH01_mDGlqa7Nk2l7RMwU2WZ1j2DP4zz9LfzCdJKs1q94PDmHVzhNFLXzI61R7IDz8z12_yvFeHxHC76X7EpQWvfiZ-5c0Gco67AuXdiHyG5Y7T8lcIi2X2I06Vgagso_7BGMfZXDAfrsz/s320/05_datasourcename.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Layer data source name is shown in Style Editor</td></tr>
</tbody></table>
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><span style="font-family: Arial, Helvetica, sans-serif;">If the name contains "_V_" you can be quite certain its a view. </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">By the way - the layer name as shown in Display Manager is often different from the table/view names the layer is based on. You have three different names by now: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">- the actual table/view name as used in the database </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">- the caption for a table/view as shown in AIA and Map </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">- the layer name in DisplayManager </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">All point to the same thing - a certain table or view - but might have (slightly) different names. </span><br />
<br />
<br />
<h2>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Modify an existing view </span></h2>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Example </b>- add a new attribute to the Fitting table and also use the attribute when styling the layer in Map. As the layer in Map is based on a view (see screenshot above) we need to modify it as well. </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">1) add new attribute to table </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbqLcAAH3ZXCkWRl00G2GapzhgGP9mN2hE93tQQamjSFf51fJjKSFGMmDMKd8HfVzpdtKX9olB5Yjqzs8-PdbSOro2w6EXnvTDMXHRr3AY7EXG_NRzkOFra86WvFqeYXL2n3sCJjoFNBkr/s1600/10_add_attribute.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="147" data-original-width="360" height="130" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbqLcAAH3ZXCkWRl00G2GapzhgGP9mN2hE93tQQamjSFf51fJjKSFGMmDMKd8HfVzpdtKX9olB5Yjqzs8-PdbSOro2w6EXnvTDMXHRr3AY7EXG_NRzkOFra86WvFqeYXL2n3sCJjoFNBkr/s320/10_add_attribute.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">2) in Form Designer drag and drop attribute to the form </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglsrqY9PDxhI0-q2og72uoFWH-0BsjfF_Z3ICtl-hGq7lo48I36qOLCsADCFIJFqw2TjgadoMZvkFzQQF9LyZsv0TOFL6cu59DG7cqdMDaa0RUDLo72T3nC2DCWVJCK8VWSEpkdw5qjjoo/s1600/11_formdesigner.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="636" data-original-width="993" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglsrqY9PDxhI0-q2og72uoFWH-0BsjfF_Z3ICtl-hGq7lo48I36qOLCsADCFIJFqw2TjgadoMZvkFzQQF9LyZsv0TOFL6cu59DG7cqdMDaa0RUDLo72T3nC2DCWVJCK8VWSEpkdw5qjjoo/s320/11_formdesigner.png" width="320" /></a></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">3) save drawing (important!) </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">4) open SQL Sheet (File menu, choose "SQL Sheet"), </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEite-khxg114AQIBCOY9DnaqVWVORrMXnselM2zCkYAvlbdvT91AT6sSkQQhtuj-rmKw8eGG7hJ4XjB60-2xyJsQ015c1vDh_aCMmTngUmj2qrmHPHJLmd_eEtjpZ0DDDbk4iZ21mdJ3hdI/s1600/12_sql_sheet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="271" data-original-width="520" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEite-khxg114AQIBCOY9DnaqVWVORrMXnselM2zCkYAvlbdvT91AT6sSkQQhtuj-rmKw8eGG7hJ4XjB60-2xyJsQ015c1vDh_aCMmTngUmj2qrmHPHJLmd_eEtjpZ0DDDbk4iZ21mdJ3hdI/s320/12_sql_sheet.png" width="320" /></a></div>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">5) choose "SqLite" and your drawing file (containing the file based IM, drawing should not be opened in Map at the same time) </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxapY274ohWGoM0MMScMO1dDsWEwa4NaMbl8UXAgtewTx77Q1HWSQoKJdfIz55Dhx81pewb4BpXHiAcKSg6XJrrkvoareebNixX8U-UtjpBMyTtmsvrgHijuenhLZyQkEzYf1dlMvSU-TF/s1600/06_connect_sqlite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="240" data-original-width="459" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxapY274ohWGoM0MMScMO1dDsWEwa4NaMbl8UXAgtewTx77Q1HWSQoKJdfIz55Dhx81pewb4BpXHiAcKSg6XJrrkvoareebNixX8U-UtjpBMyTtmsvrgHijuenhLZyQkEzYf1dlMvSU-TF/s320/06_connect_sqlite.png" width="320" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">4) in top right corner choose "Views" to get a list of all views in your current IM </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx1PtZUcYt_hk3lNDKLCDAwaWFazvlPHpR9Nwa5PhWhgO5Wk01JedJwZcDfS-xvqLqA9P75DP9ymu7go5g6y1Wb53t8crWzwobYWnaYF7dww6RNZX2rcf8S3w4uVhQRSDTgdMAYKnrrrIB/s1600/07_views.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="596" data-original-width="1345" height="141" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx1PtZUcYt_hk3lNDKLCDAwaWFazvlPHpR9Nwa5PhWhgO5Wk01JedJwZcDfS-xvqLqA9P75DP9ymu7go5g6y1Wb53t8crWzwobYWnaYF7dww6RNZX2rcf8S3w4uVhQRSDTgdMAYKnrrrIB/s320/07_views.png" width="320" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">5) select the view to modify - WA_V_FITTING - on the right hand side below the list you will see the attributes of the view </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">6) right-click on view name and choose "Modify View" - in the left side panel the view definition will be shown </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkciH2ELOuew8oPG0VVoKRboo7IoHeerFcM0aaaghWAK5GUdo8KmXvkthk7lZLN2PGAQtL9c_iJYcxKtQSE2-DJdAWsshciGDZIJ775I0aA7pTD3IdQncHUSQukMjQ1DcKZIZb2ArWVuFB/s1600/08_modify_view.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="398" data-original-width="903" height="141" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkciH2ELOuew8oPG0VVoKRboo7IoHeerFcM0aaaghWAK5GUdo8KmXvkthk7lZLN2PGAQtL9c_iJYcxKtQSE2-DJdAWsshciGDZIJ775I0aA7pTD3IdQncHUSQukMjQ1DcKZIZb2ArWVuFB/s320/08_modify_view.png" width="320" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<span style="font-family: Courier New, Courier, monospace;">CREATE VIEW WA_V_FITTING AS select g.GEOM,g.ORIENTATION, g.FID, a.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;">from <b>WA_POINT g, WA_FITTING a </b></span><br />
<span style="font-family: Courier New, Courier, monospace;">where g.FID_ATTR = a.FID</span><span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">As you can see the view takes data from two tables - WA_POINT and WA_FITTING. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">WA_POINT stores the geometry of a feature, WA_FITING stores all attributes which are useful for fittings. We added a new attribute to WA_FITTING earlier. This attribute needs to be added to the view as well. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">You can also notice a letter after each table name (g and a) - they are called "alias" in order to shorten then whole expression. Without alias (which could be a word not just a single letter) the statement would read like this: </span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">CREATE VIEW WA_V_FITTING AS select <b>WA_POINT</b>.GEOM,<b>WA_POINT</b>.ORIENTATION, <b>WA_POINT</b>.FID, <b>WA_FITTING</b>.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;">from <b>WA_POINT, WA_FITTING</b> </span><br />
<span style="font-family: Courier New, Courier, monospace;">where WA_POINT.FID_ATTR = WA_FITTING.FID </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">The alias or table name is given to indicate from which table a certain attribute comes from (required in cases where the same attribute name is used in more than one table). </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Now you only need to add your attribute name (including the alias) - don't forget to add an additional comma between the last attribute and the new attribute: </span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">CREATE VIEW WA_V_FITTING AS select g.GEOM,g.ORIENTATION, g.FID, a.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>, a.MA_SIZE</b> </span><br />
<span style="font-family: Courier New, Courier, monospace;">from WA_POINT g, WA_FITTING a </span><br />
<span style="font-family: Courier New, Courier, monospace;">where g.FID_ATTR = a.FID </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Attribute name needs to be upper cases. </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Click on the green triangle to execute the statement - you will get the following error message: </span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">... </span><br />
<span style="font-family: Courier New, Courier, monospace;">SQL execution error number 0, table WA_V_FITTING already exists </span><br />
<span style="font-family: Courier New, Courier, monospace;">... </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">We cannot overwrite a view - we have to delete the old one first and re-create it afterwards. Add the following line before the CREATE VIEW statement: </span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>DROP VIEW WA_V_FITTING; </b></span><br />
<span style="font-family: Courier New, Courier, monospace;">CREATE VIEW WA_V_FITTING AS select g.GEOM,g.ORIENTATION, g.FID, a.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;">, a.MA_SIZE </span><br />
<span style="font-family: Courier New, Courier, monospace;">from WA_POINT g, WA_FITTING a </span><br />
<span style="font-family: Courier New, Courier, monospace;">where g.FID_ATTR = a.FID </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Execute the query again, result should be:</span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SQL> DROP VIEW WA_V_FITTING </span><br />
<span style="font-family: Courier New, Courier, monospace;">Command executed (0). </span><br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SQL> CREATE VIEW WA_V_FITTING AS select g.GEOM,g.ORIENTATION, g.FID, a.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;">, a.MA_SIZE </span><br />
<span style="font-family: Courier New, Courier, monospace;">from WA_POINT g, WA_FITTING a </span><br />
<span style="font-family: Courier New, Courier, monospace;">where g.FID_ATTR = a.FID </span><br />
<span style="font-family: Courier New, Courier, monospace;">Command executed (0). </span><br />
<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">If you receive an error message like this: </span><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">SQL execution error number 0, no such column: a.MA_SIZE </span><br />
<span style="font-family: Courier New, Courier, monospace;"> 'CREATE VIEW WA_V_FITTING AS select g.GEOM,g.ORIENTATION, g.FID, a.NAME_NUMBER </span><br />
<span style="font-family: Courier New, Courier, monospace;">, a.MA_SIZE </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Did you save your drawing after adding the attribute to your table? </span><span style="font-family: Arial, Helvetica, sans-serif;">If you haven't saved the drawing SQLSheet doesn't seem to "see" the new attribute. </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">7. close SQL Sheet </span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">8. Close AIA </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">9. open AIA and reload your drawing, check the view in Data Model tree view - the attribute is now available in the view as well: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLnDa2b3wiXadQ_v73Ndn1_ooIuypitxPxUnwY6V6lZz0QE9Xkm2o-rMeapg74upU98yc6XofRipGNaWry6kSK8cEj69DgA5PsA53AToip3dDC97HrjaInXFB9Usog9qvviGz4g7MHiSY6/s1600/9_view_result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="277" data-original-width="459" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLnDa2b3wiXadQ_v73Ndn1_ooIuypitxPxUnwY6V6lZz0QE9Xkm2o-rMeapg74upU98yc6XofRipGNaWry6kSK8cEj69DgA5PsA53AToip3dDC97HrjaInXFB9Usog9qvviGz4g7MHiSY6/s320/9_view_result.png" width="320" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">Before modifying your data base with SQL Sheet - back up your drawing file. </span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com3tag:blogger.com,1999:blog-2444649326834501623.post-23369442580894376542017-08-04T10:31:00.000+02:002017-08-04T10:31:12.651+02:00Uploading MapGuide package - Exception<span style="font-family: Arial, Helvetica, sans-serif;">Uploading MapGuide package - Exception</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">If you modify a MapGuide package make sure that you zip the correct files and folders afterwards.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">I unzipped a MapGuide package, changed some values and zipped the folder but received the following error message when trying to upload the file:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Maestro error message:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">value cannot be nul</span><br />
<span style="font-family: Courier New, Courier, monospace;">Parametername: entry</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">System.ArgumentNullException: value cannot be nul</span><br />
<span style="font-family: Courier New, Courier, monospace;">Parametername: entry</span><br />
<span style="font-family: Courier New, Courier, monospace;"> bei ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream(ZipEntry entry)</span><br />
<span style="font-family: Courier New, Courier, monospace;"> bei Maestro.Packaging.PackageBuilder.UploadPackageNonTransactional(String sourceFile, UploadPackageResult result) in C:\working\JenkinsCI\home\slave_win\jobs\Maestro trunk\workspace\Maestro.Packaging\PackageBuilder.cs:Zeile 217.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">MapGuide error message:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"> ERROR_MESSAGE: An exception occurred in DWF component. File not found in archive</span><br />
<span style="font-family: Courier New, Courier, monospace;">STACK_TRACE: - MgLibraryRepositoryManager.LoadResourcePackage() line 183 file c:\working\build_area\mapguide\2.5.2\x64\mgdev\server\src\services\resource\LibraryRepositoryManager.cpp - MgResourcePackageLoader.Start() line 150 file c:\working\build_area\mapguide\2.5.2\x64\mgdev\server\src\services\resource\ResourcePackageLoader.cpp - MgResourcePackageLoader.CreateByteReader() line 108 file c:\working\build_area\mapguide\2.5.2\x64\mgdev\server\src\services\resource\ResourcePackageLoader.cpp - MgZipFileReader.ExtractArchive() line 61 file c:\working\build_area\mapguide\2.5.2\x64\mgdev\server\src\services\resource\ZipFileReader.cpp</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">My mistake was to zip the top level folder - which I got when I unzipped the package. But you need to zip the content of the top level folder, not the top level folder itself. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">AIMS 2017</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-75012244870320589262017-06-09T12:00:00.001+02:002017-06-09T12:00:40.300+02:00Map-Plot extension - iusse with FDO hatches in a rotated viewport<span style="font-family: "arial" , "helvetica" , sans-serif;">As mentioned already - back then for Map 2013 - there is an issue with hatches in a rotated viewport when using Map (FDO) layers. For details see <a href="https://raumpatrouille3d.blogspot.ch/2016/02/map-plot-batch-plotting.html" target="_blank">here</a>. The issue has not been resolved yet (Map 2017 SP1).</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">To get around it we basically replaced the problematic Map layer hatch with an AutoCAD hatch. We created 3 drawings (one for each of the print scales: 1:500, 1:1000 and 1:2000) containing only the hatches which cause issues, these hatches are plain AutoCAD hatches which print fine in a rotated viewport. These drawings were created by Map-DWG export.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">As we use our own batch plot extension (as mentioned <a href="https://raumpatrouille3d.blogspot.ch/2016/02/map-plot-batch-plotting.html" target="_blank">here</a>) I just needed to extend it in order to attach one of the three drawings as XREF automatically before the layout gets printed off.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Map 2017, SP1</span><br />
<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> ...
IPlot plot = myLibrary.FindPlot(FIDPlot);
PltPlotRenderer r = PltPlotRendererFactory.CreateRenderer(RendererConfiguration.Plot, plot, RenderingCompatibility.CurrentVersion);
r.Render(); // renders the plot as AutoCAD layout
...
// xrefs
string xref_pfad = "S:\\GIS\\Va\\Map3D2017\\Startbilder\\";
string xref_500 = "Wald_500.dwg";
string xref_1000 = "Wald_1000.dwg";
string xref_2000 = "Wald_2000.dwg";
...
string plotname = plot.Name;
string xref = xref_500;
if (plotname.Contains("500"))
xref = xref_500;
else if (plotname.Contains("1000"))
xref = xref_1000;
else
xref = xref_2000;
//attach matching xref
attachDrawing2(xref_pfad, xref);
//send xref to bottom
toBack();
// regenerate all viewports
RegenAll();
....
//copy and paste from AutoCAD forum ? - didn't keep the link,
public static void RegenAll()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
Viewport vp;
using (DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument())
{
using (Transaction tr = db.TransactionManager.StartTransaction())
{
LayoutManager lm = LayoutManager.Current;
if (lm.CurrentLayout.ToLower() == "model") db.TileMode = false;
lm.CurrentLayout = lm.CurrentLayout;
Layout layout = tr.GetObject(lm.GetLayoutId(lm.CurrentLayout), OpenMode.ForRead) as Layout;
ObjectIdCollection vpIds = layout.GetViewports();
if (vpIds.Count < 2) { ed.Regen(); return; }
ed.SwitchToModelSpace();
for (int i = 1; i < vpIds.Count; i++)
{
vp = tr.GetObject(vpIds[i], OpenMode.ForWrite) as Viewport;
ed.SwitchToModelSpace();
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("Cvport", vp.Number);
ed.Regen();
ed.SwitchToPaperSpace();
}
tr.Commit();
}
}
}
...
//copy and paste from :_http://through-the-interface.typepad.com/through_the_interface/2015/11/attaching-autocad-xrefs-and-inserting-them-at-the-origin-using-net.html
public void attachDrawing2(string filepath, string filename)
{
Database acCurDb;
acCurDb = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
string f = filepath + filename;
if (!File.Exists(f))
return ;
string name = Path.GetFileNameWithoutExtension(f);
try
{
using (var tr = acCurDb.TransactionManager.StartOpenCloseTransaction())
{
DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
using (docLock)
{
var xId = acCurDb.AttachXref(f, name);
if (xId.IsValid)
{
BlockTable acBlkTbl;
acBlkTbl = tr.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;
var btr = tr.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
Point3d insPt = new Point3d(0, 0, 0);
var br = new BlockReference(insPt, xId);
btr.AppendEntity(br);
tr.AddNewlyCreatedDBObject(br, true);
}
tr.Commit();
}
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Regen();
}
}
catch (Autodesk.AutoCAD.Runtime.Exception e)
{
MessageBox.Show(e.ToString());
}
}
...
//send XREF to bottom of draw order, copy and paste - didnt keep link
public void toBack()
{
Database acCurDb;
acCurDb = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
try
{
using (var tr = acCurDb.TransactionManager.StartTransaction())
{
DocumentLock docLock = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();
using (docLock)
{
//var bt = (BlockTable)tr.GetObject(acCurDb.BlockTableId, OpenMode.ForRead);
//var ms = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForRead);
var bt = tr.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;
var ms = tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;
DrawOrderTable drawOrderTab = tr.GetObject(ms.DrawOrderTableId, OpenMode.ForWrite) as DrawOrderTable;
ObjectIdCollection ids = new ObjectIdCollection();
// Loop through the contents of the modelspace
foreach (var id in ms)
{
// We only care about BlockReferences
var br = tr.GetObject(id, OpenMode.ForRead) as BlockReference;
if (br != null)
{
// Check whether the associated BlockTableRecord is
// an external reference
var bd = (BlockTableRecord)tr.GetObject(br.BlockTableRecord, OpenMode.ForRead);
if (bd.IsFromExternalReference)
{
ids.Add(br.ObjectId);
}
}
}
if(ids.Count> 0)
drawOrderTab.MoveToBottom(ids);
}
tr.Commit();
}
</code></pre>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-14812294986285143342017-05-24T13:58:00.000+02:002017-05-24T13:58:41.359+02:00Map Industry Model Plot Extension<span style="font-family: Arial, Helvetica, sans-serif;">If you use Map Industry Model Plot Extension make sure that the layers in your main display model do not contain a spatial filter. A spatial filter is automatically created when you save a display model. In order to remove the spatial filter you need to open the .layer file in an editor and remove the filter setting:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><Filter>GEOM ENVELOPEINTERSECTS GeomFromText('POLYGON XYZ ((698785 258855 0, 700411 258855 0, 700411 260393 0, 698785 260393 0, 698785 258855 0))')</Filter></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">to</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><Filter></Filter></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">It seems that Map applies the filter from the layer file when generating a Map plot. If the spatial filter does not match with the area you want to create a plot for the layer content will not be shown.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Map 2017, Sp1</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-77783650338861747512017-05-04T15:16:00.000+02:002017-05-04T15:17:10.587+02:00simple web site for converting drawing file into 3d pdf using FME<span style="font-family: "arial" , "helvetica" , sans-serif;">Once in while our CIVIL users want to convert a drawing file into a 3d PDF file. As they are not familiar with FME and dont have access to it anyway I set up a web page where a drawing file can be uploaded and gets converted to a 3d PDF. FME 32bit is installed on the server just for this purpose.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The website consists of two frames. The first frame allows to upload the drawing file, the second frame just lists the contents of the folder on the server where the PDF file gets stored.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is the PHP code for the upload. After uploading it triggers the execution of a BATCH file (see below) which starts the FME workbench. The workbench is a simple ACAD drawing reader connected to an 3d PDF writer. Everything is kept very simple.</span><br />
<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <html>
<body>
<script>
//refresh download frame in order to list newly created PDF file
parent.frames['download'].location.reload();
</script>
<h1>DWG zu 3D PDF</h1>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data">
DWG ausw&auml;hlen:
<input type="file" name="uploaded" id="fileToUpload"><br><br>
DWG hochladen:
<input type="submit" value="DWG hochladen" name="submit">
<br><br>
Nach dem Hochladen kann es einige Zeit dauern, bis die DWG konvertiert wurde. Bitte warten, bis eine Meldung erscheint.<br><br>
Im unteren Fenster sollte nach erfolgreicher Erstellung der PDF diese zum Download aufgelistet sein - falls nicht die gesamte Webseite aktualisieren.
<br><b>PDF bitte herunterladen (rechte Maustaste >> "Link speichern unter") - im Webbrowser werden keine 3d PDFs angezeigt.</b>
<br>
</form>
</body>
</html>
<?php
// PHP.INI
// upload_max_filesize = 20M
// --> if files are too big variables such as $_FILES['uploaded']['name'] and others are empty
// max_execution_time = 90
// FastCGI PHP in IIS execution time set to 90 secs
// Upload folder : set permissions
error_reporting(E_ALL);
if ($_POST['submit'] == '') die();
$target = "E:/www_fme_3dpdf_batch/uploads/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
//sending message to browser - doesnt work with IIS it seems :-(
//ob_implicit_flush(true);
//ob_start();
//ob_flush();
echo "<br><br>Datei <b>'". basename( $_FILES['uploaded']['name']). "'</b> hochgeladen.";
echo "<br><br>Dateikonvertierung gestartet....<br><br>";
echo "<small><pre>";
system("cmd /c E:/www_fme_3dpdf_batch/run_fme_acad2pdf.bat 2>&1", $output);
echo "</small></pre>";
}
else
{
echo "Problem aufgetreten. Datei nicht hochgeladen.";
}
?>
</code></pre>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The batch file content:</span><br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> SET SOURCE="E:\www_fme_3dpdf_batch\uploads"
SET OUTPUT="E:\www_fme_3dpdf_batch\downloads"
DEL /Q %OUTPUT%\*.*
FOR %%F IN ("%SOURCE%\*.dwg") DO (
C:\apps\FME32\fme.exe acad2pdf.fmw --SourceDataset_ACAD "%%F"^
--DestDataset_PDF "%OUTPUT%\%%~nF.pdf"^
--LOG_FILE "%OUTPUT%\%%~nF_load.log"
)
DEL /Q %SOURCE%\*.*
</code></pre>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-76318429156777011642017-03-15T17:04:00.001+01:002017-03-15T17:04:30.296+01:00Map Crash with error message "Method not found: '!!0[] System.Array.Empty()'"<span style="font-family: "arial" , "helvetica" , sans-serif;">I had my PC freshly installed and afterwards neither AutoCAD Map 2017 nor 3ds Max 2017 ran. Both crashed with error messages which looked like an .Net issue to me. Our IT department took my PC back and tried to reinstall - but to no avail. Apparently they had to change the harddisk to get both applications to run properly. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Anyway - Map and Map-Administrator run now but only if I avoid loading a third party plugin. As soon as the plugin loads both programs crash - which doesn't happen on any other PC I tried. The CER report details show the following message:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><InnerException type="System.MissingMethodException"><Message>Methode nicht gefunden: "!!0[] System.Array.Empty()".</Message><StackTrace><Method></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">It seems that the plugin was compiled against .net 4.6 but the .net runtime is lower than that. You can find a more detailed explanation <a href="https://connect.microsoft.com/VisualStudio/feedback/details/1097462/missingmethodexception-additional-information-method-not-found-0-system-array-empty" target="_blank">here</a> (reply by Alexandru).</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">That is a bit odd as Map 2017 itself requires .net 4.6 and therefore should not start up or run without 4.6 - but it does. When I checked the version of .net framework under "Installed Programs" it showed 4.6 but also 4.5:</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyGLNdPvvccV-LmgZCKiAEXuWkBKSuZm4XrI6pldWbToHumH-tgkhfbMb1mSAfaLJYrHZ8JWnCzTtd0vH_E8F00b22nWE4-Jw3R0lJfgnZg4BYaj8pzEPkL3MNjLGQCj-rZP2IXYY7FIw3/s1600/net_registry.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="17" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyGLNdPvvccV-LmgZCKiAEXuWkBKSuZm4XrI6pldWbToHumH-tgkhfbMb1mSAfaLJYrHZ8JWnCzTtd0vH_E8F00b22nWE4-Jw3R0lJfgnZg4BYaj8pzEPkL3MNjLGQCj-rZP2IXYY7FIw3/s400/net_registry.png" width="400" /></a></div>
<br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">The problem seems to be with language pack and / or registry settings. Here are the two keys where the values don't match:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1031\Version = 4.6.00081</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1033\Version = 4.5.51209</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">On second PC both keys have the same value and under "Installed Programs" it shows .net 4.6 twice:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL6aXCI3-Qapx2mSow6cpqeZZezZ9LxK5AhpQfgLlIuOxtUqGH3GGn4lKB-gXq40Cb8jTrkT_a7LiTc2IrA_nGeVvVh_K8VA_DfBh9BWWqelqnrdPY40riGTIiJ4tIFfr1eQGcZRX4AA4W/s1600/net_registry2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="18" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL6aXCI3-Qapx2mSow6cpqeZZezZ9LxK5AhpQfgLlIuOxtUqGH3GGn4lKB-gXq40Cb8jTrkT_a7LiTc2IrA_nGeVvVh_K8VA_DfBh9BWWqelqnrdPY40riGTIiJ4tIFfr1eQGcZRX4AA4W/s400/net_registry2.png" width="400" /></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Map 2017, SP1</span><br />
<div>
<br /></div>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-36073182495448763812017-03-02T14:08:00.000+01:002017-03-02T14:09:56.379+01:00MapGuide log file<span style="font-family: "arial" , "helvetica" , sans-serif;">It is good practice to monitor log files. Unfortunately MapGuide log files are not easy to read:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- StackTrace details take up more space then the message itself, it is difficult to see when an error message starts and ends</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- certain messages might appear very often although there are not really indicating an issue (such as "Session expired" message).</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is Python3 script which reads MapGuide logs files and gets rid of StackTrace details and also filters out uninteresting messages. It adds a line number so that you can find the message in the original log file quickly. It also creates a simple summary for messages and their frequency. As we have two MapGuide servers the script is configured to read two different log file folders. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">If you want to use it you need to configure:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- the path for the MapGuide log files</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- the path for saving the shortened log file </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- error messages you want to exclude</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- the number of most recent log files you want to process (such as the 3 most recent ones)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">I haven't done much in Python yet - the script doesn't do much error handling and has other shortcomings as well.</span><br />
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Thats how the result might look like:</span></div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">****************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">**************** Logfile: //wsstadt529/logfiles/MapGuide\Error.log</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">****************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><start></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">3 DATE_TIME 2017-03-02 / 01:50:19</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">4 Success: Server stopped.<span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><end></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><start></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">DATE_TIME 2017-03-02 / 01:51:23</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">6 Success: Server started.<span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><end></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><start></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">DATE_TIME 2017-03-02 / 07:27:12</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">444 Error: An exception occurred in FDO component.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">445 Error occurred in Feature Source (Library://FS_BEAR/WT_PO_BW_B/Data/TopobaseDefault.FeatureSource): Zeichenfolge ist kein gültiger Filter. (Cause: Zeichenfolge ist nicht korrekt formatiert. , Root Cause: Zeichenfolge ist nicht korrekt formatiert. )</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">446 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><end></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">...</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><start></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">DATE_TIME 2017-03-02 / 13:35:34</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">953 Error: An exception occurred in FDO component.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">954 Error occurred in Feature Source (Library://FS_BEAR/WT_PO_BW_B/Data/TopobaseDefault.FeatureSource): Zeichenfolge ist kein gültiger Filter. (Cause: Zeichenfolge ist nicht korrekt formatiert. , Root Cause: Zeichenfolge ist nicht korrekt formatiert. )</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">955 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><end></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">*********************************************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">************* Summary ***********************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">*********************************************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># 3<span class="Apple-tab-span" style="white-space: pre;"> </span> :: Error: Failed to stylize layer: ZIM_Anlageobjekte_DynaS_GeoRest_MBR</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># 36<span class="Apple-tab-span" style="white-space: pre;"> </span> :: Error: Failed to stylize layer: ZH_Orthofoto2015</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># 1<span class="Apple-tab-span" style="white-space: pre;"> </span> :: Success: Server started.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># 1<span class="Apple-tab-span" style="white-space: pre;"> </span> :: Success: Server stopped.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># 27<span class="Apple-tab-span" style="white-space: pre;"> </span> :: Error: An exception occurred in FDO component.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">************* File(s) ***********************</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;">File processed: //wsstadt529/logfiles/MapGuide\Error.log</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># of messages:68</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"># of messages excluded:<span class="Apple-tab-span" style="white-space: pre;"> </span> 51</span></div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here is the script:</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> import os
import sys
from collections import Counter
""" extract date and time from logfile line """
def extractdatetime(a_text_line):
#DateTime Format in MapGuide-LogFile:
#<2016-12-15T11:00:34> <2015-07-05T12:39:55>
date = a_text_line[1:11]
time = a_text_line[12:20]
return (date, time)
""" checks whether a certain error message should be ignored / excluded from further processing """
def isErrorMessagesToExclude(a_message):
for text_to_find in errormessage_to_exclude:
if text_to_find in a_message:
return True
return False
""" removes the StackTrace details from an error message """
def removeStackTrace(a_message):
pos = a_message.find('StackTrace:')
if pos > -1:
return a_message[0:pos]
else:
return a_message
""" saves file """
def saveFile(text, filename, mode):
f = open(filename, mode)
f.write(text)
f.close()
""" returns a sorted list of files for a given directory , sorted by date
see: http://stackoverflow.com/questions/4500564/directory-listing-based-on-time
"""
def sorted_ls(path):
mtime = lambda f: os.stat(os.path.join(path, f)).st_mtime
result = list(sorted(os.listdir(path), key=mtime))
return result
""" keeps only MapGuide Logfiles and filters out all other files """
def filterLogfiles(files_in_dir):
filtered_files = []
for filename in files_in_dir:
if filename.endswith(".log") and filename.startswith("Error"):
filtered_files.append(filename)
return filtered_files
""" processes a single MG log file and simplifies content """
def processLogFile(logfile):
# counter for line number in log file
line_number = 0
# counter for number of messages processed
counter_messages = 0
# counter for messages we exclude from processing
counter_messages_ingnored = 0
# internal counter
count_opening_tag = 0
message = ''
message_part = ''
# encoding utf-8, ascii : returns error message while reading a certain character/bytes
with open(logfile, encoding='“latin-1') as a_file:
for a_line in a_file:
line_number += 1
# all messages start with '<' and first line also contains date&time
if '<' in a_line:
count_opening_tag +=1
#get date and time
str_date, str_time = extractdatetime(a_line)
a_line = 'DATE_TIME ' + str_date + ' / ' + str_time + '\n'
# we processing the first line of the current message
if count_opening_tag == 1:
# line number and date/time information in one new line
message_part += str(line_number) + ' ' + a_line
# we have reached the first line of the following message - now we need tp process the previous message
if count_opening_tag == 2:
#first we check whether the message can be ignored
if isErrorMessagesToExclude(message_part) is False:
# we remove the StackTrace details
message_part = removeStackTrace(message_part)
counter_messages += 1
# we wrap the message text in <start><end> tags
message += '\n<start>\n'
# we add the processed message to the result
message += message_part
message += '\n<end>'
else:
counter_messages_ingnored += 1
#as this is the first line of the "next" message already a_line contains the DATE_TIME for it
message_part = a_line
# reset counter - the current line is the first line of the next message
count_opening_tag = 1
# last line reached - last message block is not yet fully processed
# code from above is repeated here to close the processing of last message in logfile
if isErrorMessagesToExclude(message_part) is False:
message_part = removeStackTrace(message_part)
message += '\n<start>\n'
message += message_part
message += '\n<end>'
counter_messages += 1
else:
counter_messages_ingnored += 1
temp = ["File processed: "+logfile, "# of messages:"+str(counter_messages), "# of messages excluded:\t "+str(counter_messages_ingnored) ]
summary_files.append(temp)
print("File processed: "+logfile)
print("# of messages:"+str(counter_messages))
print("# of messages excluded:\t "+str(counter_messages_ingnored))
return message
""" converts the newly created log file(s) summary into a list """
def convertToList(processedlogfile):
with open(processedlogfile, encoding='“latin-1') as a_file:
error_message = False
list_final = []
date_temp =''
time_temp = ''
error1_temp = ''
error2_temp = ''
line_counter = 0
for a_line in a_file:
line_counter += 1
if '<start>' in a_line:
line_counter = 1
error_message = True
if '<end>' in a_line:
error_message = False
line_counter = 0
list_temp = [date_temp, time_temp, error1_temp, error2_temp]
list_final.append(list_temp)
if error_message:
if line_counter == 2:
date_temp = a_line[10:20]
time_temp = a_line[23:]
if line_counter == 3:
error1_temp = a_line[5:].strip()
if line_counter == 4:
error2_temp = a_line[5:].strip()
return list_final
""" iterates over all relevant files and creates summary"""
def processLogfiles(logfile_dir, saveLogFileName, number_of_most_recent_files):
# create a new file for the results
saveFile('', saveLogFileName, 'w')
# get all files from directory with MapGuide logs
files_in_directory = sorted_ls(logfile_dir)
# filter out all non MapGuide log files
files_in_directory = filterLogfiles(files_in_directory)
# only process the most recent files
if(number_of_most_recent_files > 0):
index = ((number_of_most_recent_files ) * -1)
files_in_directory = files_in_directory[index:]
# interate over relevant log files
for filename in files_in_directory:
fn = os.path.join(logfile_dir, filename)
# process single log file
log_file_short = processLogFile(fn)
# create header
header = "\n\n****************"
header += "\n**************** Logfile: " + fn
header += "\n****************\n\n"
# write to file
saveFile(header, saveLogFileName, 'a')
saveFile(log_file_short, saveLogFileName, 'a')
# all files have been processed and relevant information has been written into one file
# now we want to get a summary of logged issues
resultList = convertToList(saveLogFileName)
'''
resultList is list of lists, lists have 4 items each
items 3 and 4 are equal to line 1 and 2 of a message
now we just count item 3 and get a Dictionary where frequency of message is key and message itself is value
'''
res = (Counter(mysublist[2] for mysublist in resultList))
text = "\n\n*********************************************"
text += "\n************* Summary ***********************"
text += "\n*********************************************\n\n"
for message, number in res.items():
text += "# " + str(number)+ "\t :: " + message +'\n'
# append summary
saveFile(text, saveLogFileName, 'a')
summ = "\n************* File(s) ***********************\n"
for alist in summary_files:
summ += "\n".join(alist)+"\n"
# append summary
saveFile(summ, saveLogFileName, 'a')
if __name__ == ("__main__"):
""" add any message you want to ignore when processing the log files"""
errormessage_to_exclude = [
'Session has expired',
'Resource was not found: Session:',
'Die Sitzung (',
'Error: Authentication failed'
]
# number of most recent log files to process
# 0 - for all files to be processed
# can be overwritten when python script is called with parameter
number_most_recent_files = 3
#if argument is provided we assume its a number
if len (sys.argv) == 2 :
number_most_recent_files = int(sys.argv[1])
# path to MapGuide error log directory
logfile_dir1 = '//wsstadt529/logfiles/MapGuide'
logfile_dir2 = '//wsstadt516/logfiles/MapGuide'
# file name for result - simplified log file:
saveLogFileName1 = 'c:/temp/aims_log_processed_529.txt'
saveLogFileName2 = 'c:/temp/aims_log_processed_516.txt'
# start processing
summary_files = []
processLogfiles(logfile_dir1, saveLogFileName1, number_most_recent_files)
summary_files = []
processLogfiles(logfile_dir2, saveLogFileName2, number_most_recent_files)
# open file(s) in Editor
os.startfile(saveLogFileName1)
os.startfile(saveLogFileName2)
</code></pre>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-14211412771327676242017-02-17T12:02:00.001+01:002017-02-17T12:02:34.799+01:00AutoCAD Civil installation causes problem with existing Map installation<span style="font-family: Arial, Helvetica, sans-serif;">If you install AutoCAD Map 2017 and afterwards Civil 2017 exporting a Map drawing (FDO layers) as CAD drawing (command: _MAPTOACAD) might fail.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">In particular if a template is used when exporting. Map will perform the export but will not finish the process - the dialog box won't disappear and the process cannot be cancelled. Map still uses CPU resources and needs to be closed forcefully. The drawing will be created and can be opened - but I'm not sure if all elements have been exported or not.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">I had to reinstall Map to solve the issue.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Map 2017, SP1</span>Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-36405917799547661142017-02-16T15:13:00.001+01:002017-02-16T15:22:33.822+01:00Map-Plot and plotting in background<span style="font-family: "arial" , "helvetica" , sans-serif;">Again it took me some time to figure out that Map-Plot and AutoCAD background plotting don't go well together. </span><span style="font-family: "arial" , "helvetica" , sans-serif;">With Map 2013 we did use Map Plot for plotting maps as PDFs and we did not have an issue with regards to background-plotting although I do not know whether we just had not enabled background-plotting or the behavoir has changed in Map 2017.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here are a few observations of Map 2017 and Map-Plots:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">- Map Plot batch plotting does not work, Map will crash after the second plot and no PDF will be created</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- if a single Map-plot is plotted manually (via context menu) an AutoCAD layout is being created and the map correctly rendered but it wont plot to the device (at least as long as a PDF plotter is being used), one needs to plot the AutoCAD layout manually</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- when the AutoCAD layout has been created and the layout is plotted the resulting PDF file is sometimes empty, if the layout is plotted a second time the PDF file will be fine (if background-plotting is enabled)<span class="Apple-tab-span" style="white-space: pre;"> </span></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">- when the layout has been created and the layout is plotted error messages might appear:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">FDO-Verbindung konnte nicht geöffnet werden. (cannot open FDO connection)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">ORA-01005: kein Kennwort angegeben; Anmeldung verweigert. (null password given; logon denied)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">...</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">WARNUNG: Beim Anwenden von Stilen auf das Element PLT_V_GRID_EXTLINE_TBL sind folgende Probleme aufgetreten:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Objektquelle ist nicht verbunden. (whilst applying styles to element PLT_V_GRID_EXTLINE_TBL the following issue occured: feature source not connected)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">...</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">and the PDF is created correctly (if background-plotting is enabled)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">If you use Map-plots and you run into issues check whether background plotting is enabled or not. If you need batch plotting and you get crashes as well - have a look <a href="http://raumpatrouille3d.blogspot.ch/2016/02/map-plot-batch-plotting.html" target="_blank">here</a>.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">I also noticed that disabling background-plotting seems to be ignored until Map is restarted,.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Map 2017, SP1</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0tag:blogger.com,1999:blog-2444649326834501623.post-24334984079383994872017-02-14T14:44:00.001+01:002017-02-14T14:44:32.543+01:00MapGuide Logfile - two warnings and what they mean<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">MapGuide log file contains the following warnings:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><2017-02-14T08:54:36> <span class="Apple-tab-span" style="white-space: pre;"> </span>4712<span class="Apple-tab-span" style="white-space: pre;"> </span>Ajax Viewer<span class="Apple-tab-span" style="white-space: pre;"> </span>10.99.66.2<span class="Apple-tab-span" style="white-space: pre;"> </span>Administrator</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Warning: An exception occurred in FDO component.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Beim Abrufen eines Eigenschaftenwerts stimmte der Eigenschaftentyp nicht überein. </span><br />
<span style="font-family: Courier New, Courier, monospace;"> StackTrace:</span><br />
<span style="font-family: Courier New, Courier, monospace;"> - MgStylizationUtil.ExceptionTrap() line 813 file StylizationEngine.cpp</span><span class="Apple-tab-span" style="font-family: Arial, Helvetica, sans-serif; white-space: pre;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">the error message translates roughly as </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><span style="font-family: Courier New, Courier, monospace;"> "property value and property typ do not match"</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">The message was caused by the following filter definition: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">W_ID_TYPE = 1 AND ( W_ID_TYPE_IP NULL OR NOT W_ID_TYPE_IP IN ( '1') )</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">W_ID_TYPE_IP </span><span style="font-family: Arial, Helvetica, sans-serif;">is numeric but the value is given as string. </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> The second one:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><2017-02-14T12:19:44> <span class="Apple-tab-span" style="white-space: pre;"> </span>3444<span class="Apple-tab-span" style="white-space: pre;"> </span>10.99.66.65<span class="Apple-tab-span" style="white-space: pre;"> </span>Anonymous</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Warning: An exception occurred in FDO component.</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Die Kennung 'w_id_type' wurde nicht erkannt. </span><br />
<span style="font-family: Courier New, Courier, monospace;"> StackTrace:</span><br />
<span style="font-family: Courier New, Courier, monospace;"> - MgStylizationUtil.ExceptionTrap() line 813 file StylizationEngine.cpp</span><span class="Apple-tab-span" style="font-family: Arial, Helvetica, sans-serif; white-space: pre;"> </span><span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">the error message translates roughly as </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><span style="font-family: Courier New, Courier, monospace;"> "property 'w_id_type' not found."</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The message was caused by the following filter definition: </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">w_id_type IN ( 11) AND NOT ID_SITE_TYPE IN (2007)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Property names as case-sensitive. The feature class does not contain '</span><span style="font-family: Courier New, Courier, monospace;">w_id_type</span><span style="font-family: Arial, Helvetica, sans-serif;">' but '</span><span style="font-family: Courier New, Courier, monospace;">W_ID_TYPE</span><span style="font-family: Arial, Helvetica, sans-serif;">'.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Unfortunately for both warnings no further information is given to where exactly the issues occur. </span><span style="font-family: Arial, Helvetica, sans-serif;">I stumbled across the cause of the first warning by looking for the cause of the second warning. The second warning tells you exactly what the problem is - unfortunately I only realized that after I had spent several hours looking for it. '</span><span style="font-family: Courier New, Courier, monospace;">w_id_type</span><span style="font-family: Arial, Helvetica, sans-serif;">' is an attribute we use in many feature classes and 71 layers reference the attribute in filter expressions. It was somehow obvious that there is a problem in one of the layers but not in all of them as the warning did not appear all the time. Took me quite some time to figure out what was going on - despite the warning being clear about it.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">AIMS 2017</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"> </span><br />
<div>
<br /></div>
Robhttp://www.blogger.com/profile/16968833049958804504noreply@blogger.com0