[MXD2map-devel] first impressions, support for query layers

Daniel Araujo Miranda miranda.dam at dpf.gov.br
Wed Mar 28 21:10:45 CEST 2012


Hello Stephan - and others on the list.

	I am trying to use mxd2map with ArcGis Desktop 10.0 service pack 3 
(ArcInfo) under Windows 7 Professioal and I am getting a few errors.
	Please help me out. I have about 800 layers which I would like to make 
available using mapserver and they are all styled already in ArcGIS. 
(google for Inteligeo and fosslc if you would like to know a little bit 
more about my system)
	The bottom line is that I am using ArcGIS Query Layers to add postgis 
layers WITHOUT ArcSDE, and that does not seem to be supported by 
mxd2map. I would appreciate any directions and I volunteer to contribute 
code/docs. Three sections follow: tests, bugs and feature wishlist:


===tests===

*  First try (where is the "logging file"?):

C:\Program Files (x86)\MXD2map>java -jar mxd2map.jar -m 
"c:\temp\test.mxd" -a "c:\temp\test.map" -t "c:\temp\template.map"
2012-03-28 11:27:29,146 [main] ERROR de.intevation.mxd.Converter - 
General error. See logging file for more information.


*  Second try (changed the template file path - is this a bug?):

C:\Program Files (x86)\MXD2map>java -jar mxd2map.jar -m 
"c:\temp\test.mxd" -a "c:\temp\test.map" -t example\template.map
2012-03-28 11:47:56,625 [main] ERROR 
de.intevation.mxd.reader.FeatureLayerReader - Could not read unique 
value data.java.lang.NullPointerException
2012-03-28 11:47:56,671 [main] INFO 
de.intevation.mxd.utils.MapScriptUtils - Renamed "Unidades de 
Criminalistica" to "UnidadesdeCriminalistica".
2012-03-28 11:47:56,671 [main] INFO 
de.intevation.mxd.writer.MapScriptWriter - SDE datasource found. Please 
edit password in mapfile.
Exception in thread "main" java.lang.UnknownError: loadCustomLayerDLL: 
General error message. Failed to load dynamic Layer LIB: 
c:/ms_6.1-dev/bin/ms/plugins/msplugin_sde_93.dll;msGetSymbol(): General 
error message. Can't load requested dynamic library: 
c:/ms_6.1-dev/bin/ms/plugins/msplugin_sde_93.dll
         at 
edu.umn.gis.mapscript.mapscriptJNI.layerObj_setConnectionType(Native 
Method)
         at 
edu.umn.gis.mapscript.layerObj.setConnectionType(layerObj.java:678)
         at 
de.intevation.mxd.writer.MapScriptWriter.writeLayer(MapScriptWriter.java:389) 

         at 
de.intevation.mxd.writer.MapScriptWriter.write(MapScriptWriter.java:137)
         at de.intevation.mxd.Converter.main(Converter.java:139)


* third try: Since I was unable to load msplugin_sde_93.dll, I tryed 
again copying the entire apllication to c:\mxd2map with the same results 
of the second try.

* fourth try: tried from c:\mxd2map with a very simple mxd pointing to a 
shapefile (projection not recognized - SAD69, epsg 4618):
java -jar mxd2map.jar -m "c:\temp\test2.mxd" -a "c:\temp\test.map" -t 
example\template.map
Exception in thread "main" java.lang.UnknownError: 
msProcessProjection(): Projection library error. no options found in 
'init' file
         at 
edu.umn.gis.mapscript.mapscriptJNI.mapObj_setProjection(Native Method)
         at edu.umn.gis.mapscript.mapObj.setProjection(mapObj.java:453)
         at 
de.intevation.mxd.writer.MapScriptWriter.writeMap(MapScriptWriter.java:181)
         at 
de.intevation.mxd.writer.MapScriptWriter.write(MapScriptWriter.java:135)
         at de.intevation.mxd.Converter.main(Converter.java:139)


* fifth try: reprojected the shapefile to WGS84 and updated the MXD, 
everything went fine:
C:\mxd2map>java -jar mxd2map.jar -m "c:\temp\test2.mxd" -a 
"c:\temp\test.map" -t example\template.map
2012-03-28 11:59:45,731 [main] INFO 
de.intevation.mxd.writer.MapScriptWriter - Mapfile created: c:\temp\test.map




===Possible bugs found so far===

*  does not accept arbitrary coordinate reference systems in the source 
layers. Should output a warning and fall back to a default so the user 
can fix by hand later.

*  crashes on query layers (direct postgis connection without SDE). If 
this feature is not implemented, at least try to output the layer styles.

*  "extent" line of the mapfile (line 3) uses system decimal separator 
instead of "."(dot). In my case, mxd2map wrote ","(comma) as a decimal 
separator and mapserver complained "getDouble(): Symbol definition 
error. Parsing error near (,):(line 3)"

*  mxd2map did not accept "-t" parameter (template file) with full path, 
only with relative path.

*  in windows: mapfile missing line CONFIG "PROJ LIB" "C:/ms4w/proj/nad"


===Interesting missing features===
*  support for query layers
*  support (best effort) for arbitrary CRSs.
*  a little more documentation explaining where to put the mapfile (I 
found out it has to be in c:\ms4w\Apache\cgi-bin) (I know, this belongs 
to mapserver docs, but one or two lines in the docs wouldn't hurt)
*  a little more documentation about the url invocation, which I found 
it to be "http://127.0.0.1/cgi-bin/mapserv.exe?map=test.map" (also 
belongs to mapserver docs, but I am a complete mapserver newbie)
*  mapserver template for displaying the mapfile straight from the url 
http://127.0.0.1/cgi-bin/mapserv.exe?map=test.map. Right now mapserver 
outputs "mapserver(): Web application error. Traditional BROWSE mode 
requires a TEMPLATE in the WEB section, but none was provided"



Thanks for the great product.
Best regards,
Daniel


More information about the MXD2map-devel mailing list