[Geoserver-devel] importer KML improvements

Hey devs,

I have a branch that’s mostly complete (as in, please don’t use it since I might rebase more) that adds a bit more support to KML importing: https://github.com/ischneider/geoserver/tree/importer-kml-style-clean

Related geotools changes here: https://github.com/ischneider/geotools/tree/kml-parsing-improvements

The main thing I wanted to discuss was the approach for supporting one of the new features. Because KML can contain mixed geometry types, this new feature supports creating a new featuretype by geometry type, if the user chooses. So for example, if the uploaded file is data.kml, the resulting featuretypes will be datapoint, datamultilinestring and datapolygon assuming the data contains these types of geometries.

The issue is the activation of this feature. Because the importer immediately parses the KML/KMZ to determine the resulting tasks, this option must be supplied upfront with the request to avoid a potentially expensive 2nd parsing or modifying the way the API work (like allowing this option to be specified later or changing the protocol for initiating the import and tasks).

Right now, triggering this option is implemented via the REST API and a URL parameter that gets passed along to the ImportData, eventually making it to the KMLFileFormat used to collate and create the feature types.

Any ideas on how to make this work better?
Other thoughts on the two patches?

As a reminder, I’m expecting some additional efforts on these so please don’t do anything with them besides look :wink:

Ian Schneider
Software Engineer | Boundless
ischneider@anonymised.com

Hey Ian,

···

On Tue, Apr 1, 2014 at 3:08 PM, Ian Schneider <ischneider@anonymised.com> wrote:

Hey devs,

I have a branch that’s mostly complete (as in, please don’t use it since I might rebase more) that adds a bit more support to KML importing: https://github.com/ischneider/geoserver/tree/importer-kml-style-clean

Related geotools changes here: https://github.com/ischneider/geotools/tree/kml-parsing-improvements

The main thing I wanted to discuss was the approach for supporting one of the new features. Because KML can contain mixed geometry types, this new feature supports creating a new featuretype by geometry type, if the user chooses. So for example, if the uploaded file is data.kml, the resulting featuretypes will be datapoint, datamultilinestring and datapolygon assuming the data contains these types of geometries.

Just so I understand it basically the feature is to take a single KML file and do an import that results in multiple layers, one for each geometry type?

The issue is the activation of this feature. Because the importer immediately parses the KML/KMZ to determine the resulting tasks, this option must be supplied upfront with the request to avoid a potentially expensive 2nd parsing or modifying the way the API work (like allowing this option to be specified later or changing the protocol for initiating the import and tasks).

Right now, triggering this option is implemented via the REST API and a URL parameter that gets passed along to the ImportData, eventually making it to the KMLFileFormat used to collate and create the feature types.

Passing down custom options makes sense. Wondering about the Web UI cases though… i guess we won’t have the same facility there?

Any ideas on how to make this work better?
Other thoughts on the two patches?

As a reminder, I’m expecting some additional efforts on these so please don’t do anything with them besides look :wink:

Ian Schneider
Software Engineer | Boundless
ischneider@anonymised.com



Geoserver-devel mailing list
Geoserver-devel@anonymised.comt
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Justin Deoliveira
Vice President, Engineering | Boundless
jdeolive@anonymised.com
@j_deolive

Hi Justin,

···

Replies inline:

On Thu, Apr 3, 2014 at 8:46 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hey Ian,

Right. In this case, the client has a specific use-case that requires this. To be clear, the default behavior is to import into a single layer.

Right, forgot to mention this. While it’s easy to document this in the REST API and let the client provide the option while initiating the import, we’ll either need to hard-code some set of pre-import options into the UI or support ‘discovery’ of these. I suppose this option might make sense for all formats at some point but for the moment, the client will be using the REST API, so it’s not critical for this case.

Thanks for looking.

Ian Schneider
Software Engineer | Boundless
ischneider@anonymised.com…

On Tue, Apr 1, 2014 at 3:08 PM, Ian Schneider <ischneider@anonymised.com> wrote:

Hey devs,

I have a branch that’s mostly complete (as in, please don’t use it since I might rebase more) that adds a bit more support to KML importing: https://github.com/ischneider/geoserver/tree/importer-kml-style-clean

Related geotools changes here: https://github.com/ischneider/geotools/tree/kml-parsing-improvements

The main thing I wanted to discuss was the approach for supporting one of the new features. Because KML can contain mixed geometry types, this new feature supports creating a new featuretype by geometry type, if the user chooses. So for example, if the uploaded file is data.kml, the resulting featuretypes will be datapoint, datamultilinestring and datapolygon assuming the data contains these types of geometries.

Just so I understand it basically the feature is to take a single KML file and do an import that results in multiple layers, one for each geometry type?

The issue is the activation of this feature. Because the importer immediately parses the KML/KMZ to determine the resulting tasks, this option must be supplied upfront with the request to avoid a potentially expensive 2nd parsing or modifying the way the API work (like allowing this option to be specified later or changing the protocol for initiating the import and tasks).

Right now, triggering this option is implemented via the REST API and a URL parameter that gets passed along to the ImportData, eventually making it to the KMLFileFormat used to collate and create the feature types.

Passing down custom options makes sense. Wondering about the Web UI cases though… i guess we won’t have the same facility there?