[Geoserver-devel] WFS DXF OutputFormat community module proposal

We have developed a WFSOutputFormat to write DXF (plain or zipped) in response to a GetFeature request.
If anyone is interested in it, we would like to commit it as a community module.

Some features from the README:

There have been multiple revisions of the format, so we need to choose a "version"
of DXF to write. The extension implements version 14, but can be easily extended
(through SPI providers) to write other versions too.

Each single query is rendered as a layer. Geometries are encoded as
entities (if simple enough to be expressed by a single DXF geometry
type) or blocks (if complex, such as polygons with holes or collections).

Some options are available to control the output generated. They are
described in the following paragraphs.

GET requests format_options
------------------------------------------------------------------------------
The following format_options are supported:
1) version: (number) creates a DXF in the specified version format
2) asblock: (true/false) if true, all geometries are written as blocks
and then inserted as entities. If false, simple geometries are directly
written as entities.
3) colors: (comma delimited list of numbers): colors to be used for the
DXF layers, in sequence. If layers are more than the specified colors, they
will be reused many times. A set of default colors is used if the option is
not used. Colors are AutoCad color numbers (7=white, etc.).
4) ltypes: (comma delimited list of line type descriptors): line types
to be used for the DXF layers, in sequence. If layers are more than
the specified line types, they will be reused many times. If not specified,
all layers will be given a solid, continuous line type. A descriptor
has the following format: <name>!<repeatable pattern>[!<base length>], where
<name> is the name assigned to the line type, <base length> (optional)
is a real number that tells how long is each part of the line pattern
(defaults to 0.125), and <repeatable pattern> is a visual description
of the repeatable part of the line pattern, as a sequence of - (solid line),
* (dot) and _ (empty space). For example a dash-dot pattern would be expressed
as --_*_.
5) layers: (comma delimited list of strings) names to be assigned to
the DXF layers. If specified, must contain a name for each requested
query. By default a standard name will be assigned to layers.

POST options
------------------------------------------------------------------------------
Unfortunately, it's not currently possibile to use format_options in POST
requests. The only thing we chose to implement is the layers options, via
the handle attribute of Query attributes. So, if specified, the layer
of a Query will be named as its handle attribute.
The handle attribute of the GetFeature tag can also be used to override
the name of the file produced.

Mauro Bartolomeoli ha scritto:

We have developed a WFSOutputFormat to write DXF (plain or zipped) in response to a GetFeature request.
If anyone is interested in it, we would like to commit it as a community module.

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

Another thing that comes to mind is Autocad Map, as far as I remember
it had some way to attach attributes to the geometries using block
attributes or something like that. Is this kind of output
envisaged? Just curious.

Some features from the README:

There have been multiple revisions of the format, so we need to choose a "version"
of DXF to write. The extension implements version 14, but can be easily extended
(through SPI providers) to write other versions too.

Each single query is rendered as a layer. Geometries are encoded as
entities (if simple enough to be expressed by a single DXF geometry
type) or blocks (if complex, such as polygons with holes or collections).

Some options are available to control the output generated. They are
described in the following paragraphs.

GET requests format_options
------------------------------------------------------------------------------
The following format_options are supported:
1) version: (number) creates a DXF in the specified version format
2) asblock: (true/false) if true, all geometries are written as blocks
and then inserted as entities. If false, simple geometries are directly
written as entities.
3) colors: (comma delimited list of numbers): colors to be used for the
DXF layers, in sequence. If layers are more than the specified colors, they
will be reused many times. A set of default colors is used if the option is
not used. Colors are AutoCad color numbers (7=white, etc.).
4) ltypes: (comma delimited list of line type descriptors): line types
to be used for the DXF layers, in sequence. If layers are more than
the specified line types, they will be reused many times. If not specified,
all layers will be given a solid, continuous line type. A descriptor
has the following format: <name>!<repeatable pattern>[!<base length>], where
<name> is the name assigned to the line type, <base length> (optional)
is a real number that tells how long is each part of the line pattern
(defaults to 0.125), and <repeatable pattern> is a visual description
of the repeatable part of the line pattern, as a sequence of - (solid line),
* (dot) and _ (empty space). For example a dash-dot pattern would be expressed
as --_*_.
5) layers: (comma delimited list of strings) names to be assigned to
the DXF layers. If specified, must contain a name for each requested
query. By default a standard name will be assigned to layers.

POST options
------------------------------------------------------------------------------
Unfortunately, it's not currently possibile to use format_options in POST
requests. The only thing we chose to implement is the layers options, via
the handle attribute of Query attributes. So, if specified, the layer
of a Query will be named as its handle attribute.
The handle attribute of the GetFeature tag can also be used to override
the name of the file produced.

Afaik one can make mixed requests, passing the format options in the
URL and the rest of the request in xml format

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Andrea Aime wrote:

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

I have looked at it before starting the project and It seemed it was not able to export in that format (anyone expert in OGR stuff can tell us more about this?).

Another thing that comes to mind is Autocad Map, as far as I remember
it had some way to attach attributes to the geometries using block
attributes or something like that. Is this kind of output
envisaged? Just curious.

For now, it's just exporting geometries, but if we can find some fundings, we can surely extend it in that direction.

Afaik one can make mixed requests, passing the format options in the
URL and the rest of the request in xml format

I tried, but it seems the kvp parser complains about missing parameters if I specify only format_options (for example it complains about missing typeNames).

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Yes, I think there's no legal issue with DXF.

Thanks,
Mauro

Mauro Bartolomeoli ha scritto:

Andrea Aime wrote:

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

I have looked at it before starting the project and It seemed it was not able to export in that format (anyone expert in OGR stuff can tell us more about this?).

It seems it was dropped.
The driver was still available in version 1.4.x based on the dwg
direct library:
http://svn.osgeo.org/gdal/branches/1.4/gdal/ogr/ogrsf_frmts/dxfdwg/

but since the 1.5.x branch it's no more there:
http://svn.osgeo.org/gdal/branches/1.5/gdal/ogr/ogrsf_frmts/
http://svn.osgeo.org/gdal/trunk/gdal/ogr/ogrsf_frmts/

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Yes, I think there's no legal issue with DXF.

Then go ahead and add the new output format to the community section,
and thanks a lot for contributing it :slight_smile:
Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

First off, nice!! I think this will be a great extension. Thanks for contributing.

Mauro Bartolomeoli wrote:

Andrea Aime wrote:

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

I have looked at it before starting the project and It seemed it was not able to export in that format (anyone expert in OGR stuff can tell us more about this?).

Another thing that comes to mind is Autocad Map, as far as I remember
it had some way to attach attributes to the geometries using block
attributes or something like that. Is this kind of output
envisaged? Just curious.

For now, it's just exporting geometries, but if we can find some fundings, we can surely extend it in that direction.

Afaik one can make mixed requests, passing the format options in the
URL and the rest of the request in xml format

I tried, but it seems the kvp parser complains about missing parameters if I specify only format_options (for example it complains about missing typeNames).

My guess is that the method of the request might be off? Are you sure a POST request is being made?

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Yes, I think there's no legal issue with DXF.

I believe you are familiar with the community process Mauro, but if you want a refresher:

http://docs.geoserver.org/1.7.x/developer/policies/community-modules.html

Thanks,
Mauro

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Just done on 1.7.x branch. Now I'll try to see if it needs any change to compile on trunk.

Thanks,
Mauro

Justin Deoliveira wrote:

First off, nice!! I think this will be a great extension. Thanks for contributing.

Mauro Bartolomeoli wrote:

Andrea Aime wrote:

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

I have looked at it before starting the project and It seemed it was not able to export in that format (anyone expert in OGR stuff can tell us more about this?).

Another thing that comes to mind is Autocad Map, as far as I remember
it had some way to attach attributes to the geometries using block
attributes or something like that. Is this kind of output
envisaged? Just curious.

For now, it's just exporting geometries, but if we can find some fundings, we can surely extend it in that direction.

Afaik one can make mixed requests, passing the format options in the
URL and the rest of the request in xml format

I tried, but it seems the kvp parser complains about missing parameters if I specify only format_options (for example it complains about missing typeNames).

My guess is that the method of the request might be off? Are you sure a POST request is being made?

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Yes, I think there's no legal issue with DXF.

I believe you are familiar with the community process Mauro, but if you want a refresher:

http://docs.geoserver.org/1.7.x/developer/policies/community-modules.html

Thanks,
Mauro

------------------------------------------------------------------------------

Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Mauro Bartolomeoli ha scritto:

Just done on 1.7.x branch. Now I'll try to see if it needs any change to compile on trunk.

Just tried it out on 1.7.x, exported States in dxf and opened it back
with QCad (screenshot attached).

Aaah, brings back memories of high school, I was doing exports of
cad drawings in dxf and then processed them with little turbo pascal
programs to apply templates on them (very rudimentary parametric cad)
:slight_smile:

Thanks again for the contribution!

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

(attachments)

states_qcad.png

Dear Mauro,
Thank you for this valuable module. What is the easiest way for me to try it out?

Thanks,
Roger

--------------------------------------------------
From: "Mauro Bartolomeoli" <m.bartolomeoli@anonymised.com>
Sent: Thursday, July 09, 2009 9:39 AM
To: "Justin Deoliveira" <jdeolive@anonymised.com>
Cc: <geoserver-devel@lists.sourceforge.net>; "Andrea Aime" <aaime@anonymised.com>
Subject: Re: [Geoserver-devel] WFS DXF OutputFormat community module proposal

Just done on 1.7.x branch. Now I'll try to see if it needs any change to
compile on trunk.

Thanks,
Mauro

Justin Deoliveira wrote:

First off, nice!! I think this will be a great extension. Thanks for
contributing.

Mauro Bartolomeoli wrote:

Andrea Aime wrote:

Wow, this looks great, from WebGIS to the most popular CAD system.

One question is how this overlaps with the OGR output format, as far as
I remember OGR is also able to deal with DXF... or maybe not?
http://www.gdal.org/ogr/ogr_formats.html
Hmmm... maybe they dropped support for that due to legal issues with
OpenDWG.

I have looked at it before starting the project and It seemed it was
not able to export in that format (anyone expert in OGR stuff can
tell us more about this?).

Another thing that comes to mind is Autocad Map, as far as I remember
it had some way to attach attributes to the geometries using block
attributes or something like that. Is this kind of output
envisaged? Just curious.

For now, it's just exporting geometries, but if we can find some
fundings, we can surely extend it in that direction.

Afaik one can make mixed requests, passing the format options in the
URL and the rest of the request in xml format

I tried, but it seems the kvp parser complains about missing
parameters if I specify only format_options (for example it complains
about missing typeNames).

My guess is that the method of the request might be off? Are you sure
a POST request is being made?

As far as I remember DXF is an open spec and there are no legal
issues implementing it in a product, right?
If so, +1 for community area.

Yes, I think there's no legal issue with DXF.

I believe you are familiar with the community process Mauro, but if
you want a refresher:

http://docs.geoserver.org/1.7.x/developer/policies/community-modules.html

Thanks,
Mauro

------------------------------------------------------------------------------

Enter the BlackBerry Developer Challenge This is your chance to win
up to $100,000 in prizes! For a limited time, vendors submitting new
applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Hi Mauro,
I tried it, and seems to work fine, but I didn't try anything complicated.

Roger

--------------------------------------------------
From: "Mauro Bartolomeoli" <m.bartolomeoli@anonymised.com>
Sent: Wednesday, July 08, 2009 3:40 PM
To: <geoserver-devel@lists.sourceforge.net>
Subject: [Geoserver-devel] WFS DXF OutputFormat community module proposal

We have developed a WFSOutputFormat to write DXF (plain or zipped) in
response to a GetFeature request.
If anyone is interested in it, we would like to commit it as a community
module.

Some features from the README:

There have been multiple revisions of the format, so we need to choose a
"version"
of DXF to write. The extension implements version 14, but can be easily
extended
(through SPI providers) to write other versions too.

Each single query is rendered as a layer. Geometries are encoded as
entities (if simple enough to be expressed by a single DXF geometry
type) or blocks (if complex, such as polygons with holes or collections).

Some options are available to control the output generated. They are
described in the following paragraphs.

GET requests format_options
------------------------------------------------------------------------------
The following format_options are supported:
1) version: (number) creates a DXF in the specified version format
2) asblock: (true/false) if true, all geometries are written as blocks
and then inserted as entities. If false, simple geometries are directly
written as entities.
3) colors: (comma delimited list of numbers): colors to be used for the
DXF layers, in sequence. If layers are more than the specified colors, they
will be reused many times. A set of default colors is used if the option is
not used. Colors are AutoCad color numbers (7=white, etc.).
4) ltypes: (comma delimited list of line type descriptors): line types
to be used for the DXF layers, in sequence. If layers are more than
the specified line types, they will be reused many times. If not specified,
all layers will be given a solid, continuous line type. A descriptor
has the following format: <name>!<repeatable pattern>[!<base length>],
where
<name> is the name assigned to the line type, <base length> (optional)
is a real number that tells how long is each part of the line pattern
(defaults to 0.125), and <repeatable pattern> is a visual description
of the repeatable part of the line pattern, as a sequence of - (solid line),
* (dot) and _ (empty space). For example a dash-dot pattern would be
expressed
as --_*_.
5) layers: (comma delimited list of strings) names to be assigned to
the DXF layers. If specified, must contain a name for each requested
query. By default a standard name will be assigned to layers.

POST options
------------------------------------------------------------------------------
Unfortunately, it's not currently possibile to use format_options in POST
requests. The only thing we chose to implement is the layers options, via
the handle attribute of Query attributes. So, if specified, the layer
of a Query will be named as its handle attribute.
The handle attribute of the GetFeature tag can also be used to override
the name of the file produced.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Fine, let me know if you find any problem using it.

Thanks,
Mauro

Roger Bedell wrote:

Hi Mauro,
I tried it, and seems to work fine, but I didn't try anything complicated.

Roger
  

Hi There,

I'm trying to build the dxf module, but it keeps giving me this error when
maven runs the tests:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.geoserver.wfs.response.dxf.util.JulianDateTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.062 sec
<<< FAILURE!
Running org.geoserver.wfs.response.DXFOutputFormatTest
05 Jan 12:03:35 ERROR [geoserver.ows] -
java.lang.UnsupportedOperationException: Version 13 not supported by dxf
output format
        at
org.geoserver.wfs.response.DXFOutputFormat.write(DXFOutputFormat.java:254)

( . . . )

Results :

Failed tests:
  testSimple(org.geoserver.wfs.response.dxf.util.JulianDateTest)

I'm guessing something is not right with the JulianDate? :-/

Best Regards.

Mauro Bartolomeoli wrote:

Fine, let me know if you find any problem using it.

Thanks,
Mauro

Roger Bedell wrote:

Hi Mauro,
I tried it, and seems to work fine, but I didn't try anything
complicated.

Roger
  
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
View this message in context: http://old.nabble.com/WFS-DXF-OutputFormat-community-module-proposal-tp24393222p27026591.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.