[Geoserver-devel] dxf plugin

Hi geoserver folks.

Does anybody had success to build and use the dxf plugin to be found in svn?

Thanks in advance, Lars

Which dxf plugin are you referring to? The only dxf plugin I know of anywhere in the GeoServer/Tools universe is a community plug-in in uDig:
http://svn.geotools.org/udig/community/wendy/

I have no idea on the status with it. Another possibility, though it's far from ready, would be an OGRDataStore, which could handle DXF. But basically there's no easy way to serve DXF through GeoServer at the moment.

best regards,

Chris

Lars Martin wrote:

Hi geoserver folks.

Does anybody had success to build and use the dxf plugin to be found in svn?

Thanks in advance, Lars

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,45d04521200351995013331!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Chris Holmes schrieb:
> Which dxf plugin are you referring to? The only dxf plugin I know
> of anywhere in the GeoServer/Tools universe is a community plug-in
> in uDig: http://svn.geotools.org/udig/community/wendy/

Yes, that's the plugin I mean.

> I have no idea on the status with it. Another possibility, though
> it's far from ready, would be an OGRDataStore, which could handle
> DXF. But basically there's no easy way to serve DXF through
> GeoServer at the moment.

Actually I was able to build a DXF plugin based on a commercial Java DXF reader (http://caff.de/dxfviewer/) It is really fast and the DXF parsing engine is quite well.

If I configure that DXF FeatureType in Geoserver 1.5-b2 to read a DXF (EPSG:31468) file with several thousands of lines and polygones I get the following bounding box based on the generated FeatureCollection:

EPSG:31468
min X: 4427254.133 min Y: 5637560.101
max X: 4588856.021 max Y: 5755519.077

EPSG:4326
Min Long: 10.942268588348599 Min Lat: 50.868388794149425
Max Long: 13.291915984604449 Max Lat: 51.93557940242896

This is somewhere in Central Germany and sounds reasonable to me.

If I now start the map preview with that FeatureType I get an empty preview and an exception saying

"The provided envelope is outside the source CRS definition area"

Any hints on where to start searching? Any chance to debug the requested bounding box? The exception is produced somewhere deep in GT:

at org.geotools.renderer.lite.RendererUtilities.calculateScale(RendererUtilities.java:540)

Thanks in advance. Lars

Lars Martin wrote:

Chris Holmes schrieb:
> Which dxf plugin are you referring to? The only dxf plugin I know
> of anywhere in the GeoServer/Tools universe is a community plug-in
> in uDig: http://svn.geotools.org/udig/community/wendy/

Yes, that's the plugin I mean.

> I have no idea on the status with it. Another possibility, though
> it's far from ready, would be an OGRDataStore, which could handle
> DXF. But basically there's no easy way to serve DXF through
> GeoServer at the moment.

Actually I was able to build a DXF plugin based on a commercial Java DXF reader (http://caff.de/dxfviewer/) It is really fast and the DXF parsing engine is quite well.

Very cool. Any chance you could make your plug-in code available, others might be interested.

If I configure that DXF FeatureType in Geoserver 1.5-b2 to read a DXF (EPSG:31468) file with several thousands of lines and polygones I get the following bounding box based on the generated FeatureCollection:

EPSG:31468
min X: 4427254.133 min Y: 5637560.101
max X: 4588856.021 max Y: 5755519.077

EPSG:4326
Min Long: 10.942268588348599 Min Lat: 50.868388794149425
Max Long: 13.291915984604449 Max Lat: 51.93557940242896

This is somewhere in Central Germany and sounds reasonable to me.

If I now start the map preview with that FeatureType I get an empty preview and an exception saying

"The provided envelope is outside the source CRS definition area"

Hmmmm... Does the WFS work? It generally gets less errors, and want to be sure that data is in fact getting returned.

Any hints on where to start searching? Any chance to debug the requested bounding box? The exception is produced somewhere deep in GT:

at org.geotools.renderer.lite.RendererUtilities.calculateScale(RendererUtilities.java:540)

If you could include the full stack trace we may be able to better diagnose the problem. It's most likely that your missing a small bit of code in your plug-in or some such.

best regards,

Chris

Thanks in advance. Lars

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:1003,45d43b85218247731818748!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Chris Holmes ha scritto:
...

If I configure that DXF FeatureType in Geoserver 1.5-b2 to read a DXF (EPSG:31468) file with several thousands of lines and polygones I get the following bounding box based on the generated FeatureCollection:

EPSG:31468
min X: 4427254.133 min Y: 5637560.101
max X: 4588856.021 max Y: 5755519.077

EPSG:4326
Min Long: 10.942268588348599 Min Lat: 50.868388794149425
Max Long: 13.291915984604449 Max Lat: 51.93557940242896

This is somewhere in Central Germany and sounds reasonable to me.

If I now start the map preview with that FeatureType I get an empty preview and an exception saying

"The provided envelope is outside the source CRS definition area"

The scale computation algorithm did change just after beta2 was released, can you try out rc1?
Cheers
Andrea

Andrea Aime schrieb:

The scale computation algorithm did change just after beta2 was released, can you try out rc1?

Thanks for that hint. I will give the RC release a try. Lars Martin

Lars Martin schrieb:

The scale computation algorithm did change just after beta2 was released, can you try out rc1?

Hi Andrea. I've installed the RC1 package. Now the logs produce much more debug information

SCHWERWIEGEND: Could not turn the original envelope in one into the declared CRS for type DXF_BEREICH
19.02.2007 09:35:53 org.vfny.geoserver.global.FeatureTypeInfo getBoundingBox
SCHWERWIEGEND: Original CRS is null
19.02.2007 09:35:53 org.vfny.geoserver.global.FeatureTypeInfo getBoundingBox
SCHWERWIEGEND: Declared CRS is PROJCS["DHDN / Gauss-Kruger zone 4",
   GEOGCS["DHDN",
     DATUM["Deutsches Hauptdreiecksnetz",
       SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]],
       TOWGS84[598.1, 73.7, 418.2, 0.202, 0.045, -2.455, 1.3819742018555456],
       AUTHORITY["EPSG","6314"]],
     PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
     UNIT["degree", 0.017453292519943295],
     AXIS["Geodetic longitude", EAST],
     AXIS["Geodetic latitude", NORTH],
     AUTHORITY["EPSG","4314"]],
   PROJECTION["Transverse Mercator", AUTHORITY["EPSG","9807"]],
   PARAMETER["central_meridian", 12.0],
   PARAMETER["latitude_of_origin", 0.0],
   PARAMETER["scale_factor", 1.0],
   PARAMETER["false_easting", 4500000.0],
   PARAMETER["false_northing", 0.0],
   UNIT["m", 1.0],
   AXIS["Easting", EAST],
   AXIS["Northing", NORTH],
   AUTHORITY["EPSG","31468"]]

Where does the "original envelope" and "original CRS" come from?

If I start the map preview I get a JavaScript error saying: "unsupported map projection: EPSG:31468" but no additional logs on server side.

When starting the FeatureType editor for DXF FeatureType the log records:

19.02.2007 09:47:22 org.vfny.geoserver.action.data.DataFeatureTypesSelectAction execute
INFO: setting session and user ftConfig to : FeatureTypeConfig[name: DXF_BEREICH schemaName: null SRS: 31468 schemaAttributes: [org.vfny.geoserver.config.AttributeTypeInfoConfig@anonymised.com] schemaBase null]

Does that "null" schemaBase may imply some error in my plugin implementation?

Thanks, Lars

Lars Martin schrieb:

Lars Martin schrieb:

The scale computation algorithm did change just after beta2 was released, can you try out rc1?

If I create a new DXF FeatureType the console (but not the logfile) records:

2548900 [INFO] org.geotools.data.dxf.DxfFeatureReader - getCount: FG_FLB_FREMDLEITUNG$LINIE25000 ... 216
Original envelope: Env[4426074.555 : 4590227.273, 5633188.382 : 5774203.777]
Declared envelope: Env[4426074.555 : 4590227.273, 5633188.382 : 5774203.777]

Don't know where it comes from but obviously there seems to be an "original envelope". Any hints?

Lars Martin ha scritto:

Lars Martin schrieb:

The scale computation algorithm did change just after beta2 was released, can you try out rc1?

Hi Andrea. I've installed the RC1 package. Now the logs produce much more debug information

SCHWERWIEGEND: Could not turn the original envelope in one into the declared CRS for type DXF_BEREICH

Hmm... this I have to investigate, but I have no time now....
looks like a bug thought.
Can you turn FINE logging on and see if some more error messages
pop up after this one?

19.02.2007 09:35:53 org.vfny.geoserver.global.FeatureTypeInfo getBoundingBox
SCHWERWIEGEND: Original CRS is null
19.02.2007 09:35:53 org.vfny.geoserver.global.FeatureTypeInfo getBoundingBox
SCHWERWIEGEND: Declared CRS is PROJCS["DHDN / Gauss-Kruger zone 4",
   GEOGCS["DHDN",
     DATUM["Deutsches Hauptdreiecksnetz",
       SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]],
       TOWGS84[598.1, 73.7, 418.2, 0.202, 0.045, -2.455, 1.3819742018555456],
       AUTHORITY["EPSG","6314"]],
     PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
     UNIT["degree", 0.017453292519943295],
     AXIS["Geodetic longitude", EAST],
     AXIS["Geodetic latitude", NORTH],
     AUTHORITY["EPSG","4314"]],
   PROJECTION["Transverse Mercator", AUTHORITY["EPSG","9807"]],
   PARAMETER["central_meridian", 12.0],
   PARAMETER["latitude_of_origin", 0.0],
   PARAMETER["scale_factor", 1.0],
   PARAMETER["false_easting", 4500000.0],
   PARAMETER["false_northing", 0.0],
   UNIT["m", 1.0],
   AXIS["Easting", EAST],
   AXIS["Northing", NORTH],
   AUTHORITY["EPSG","31468"]]

Where does the "original envelope" and "original CRS" come from?

From you datastore :slight_smile:
Original envelope is computed quickly using FeatureSource.getBounds or,
if you don't provide it, by scanning all the data in your store.
Original CRS should be attached to your data default geometry attribute, but there is none (not surprising, dxf is in CAD space usually), thought
you could add support for a sibling xxx.prj file where you can
declare the CRS (just like shapefiles do).

If I start the map preview I get a JavaScript error saying: "unsupported map projection: EPSG:31468" but no additional logs on server side.

You can ignore this, it's MapBuilder complaning it does not know about
the projection, so it won't be able to turn map coordinates into a lat/lon indication in the lat/lon boxes you can find upper left.

19.02.2007 09:47:22 org.vfny.geoserver.action.data.DataFeatureTypesSelectAction execute
INFO: setting session and user ftConfig to : FeatureTypeConfig[name: DXF_BEREICH schemaName: null SRS: 31468 schemaAttributes: [org.vfny.geoserver.config.AttributeTypeInfoConfig@anonymised.com] schemaBase null]

Does that "null" schemaBase may imply some error in my plugin implementation?

No idea on this one neither, needs investigation, I can't do that now.
Maybe in the afternoon I'll find some time.

Cheers
Andrea

Chris Holmes schrieb:

If I configure that DXF FeatureType in Geoserver 1.5-b2 to read a DXF (EPSG:31468) file with several thousands of lines and polygones I get the following bounding box based on the generated FeatureCollection:

EPSG:31468
min X: 4427254.133 min Y: 5637560.101
max X: 4588856.021 max Y: 5755519.077

EPSG:4326
Min Long: 10.942268588348599 Min Lat: 50.868388794149425
Max Long: 13.291915984604449 Max Lat: 51.93557940242896

This is somewhere in Central Germany and sounds reasonable to me.

If I now start the map preview with that FeatureType I get an empty preview and an exception saying

"The provided envelope is outside the source CRS definition area"

Hmmmm... Does the WFS work? It generally gets less errors, and want to be sure that data is in fact getting returned.

The WFS reponse ist:

http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:FG_FLB_FREMDLEITUNG$LINIE25000

<xs:schema targetNamespace="http://www.openplans.org/topp&quot; elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:import namespace="http://www.opengis.net/gml&quot; schemaLocation="http://localhost:8080/geoserver/schemas/gml/2.1.2/feature.xsd&quot;/&gt;
<xs:complexType name="FG_FLB_FREMDLEITUNG$LINIE25000_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="GEOMETRY" minOccurs="0" nillable="true" type="gml:LineStringPropertyType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="FG_FLB_FREMDLEITUNG$LINIE25000" type="topp:FG_FLB_FREMDLEITUNG$LINIE25000_Type" substitutionGroup="gml:_Feature"/>
</xs:schema>

http://localhost:8080/geoserver/wfs/GetFeature?typeName=topp:FG_FLB_FREMDLEITUNG$LINIE25000

<wfs:FeatureCollection xsi:schemaLocation="http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=topp:FG_FLB_FREMDLEITUNG$LINIE25000 http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
</wfs:FeatureCollection>

http://localhost:8080/geoserver/wfs/GetCapabilities

<FeatureType>
<Name>topp:FG_FLB_FREMDLEITUNG$LINIE25000</Name>
<Title>FG_FLB_FREMDLEITUNG$LINIE25000_Type</Title>
<Abstract>Generated from dxf</Abstract>
<Keywords>FG_FLB_FREMDLEITUNG$LINIE25000 dxf</Keywords>
<SRS>EPSG:31468</SRS>
<LatLongBoundingBox minx="10.919736184876994" miny="50.82708344384268" maxx="13.315048843184082" maxy="52.10157267714198"/>
</FeatureType>

Lars Martin schrieb:

This is somewhere in Central Germany and sounds reasonable to me.

If I now start the map preview with that FeatureType I get an empty preview and an exception saying

I got it. To simple to recognize it: I didn't reset my FeatureIterator wrapper after the first run. So the bbox calculation was correct but afterwards no features where found to display because the iterator was at the end already. :smiley: Thanks for all the help. Lars