Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-21 Thread Ian Turton
That sounds like a reasonable solution. Ian On Thu, 21 May 2020 at 14:40, Andrea Aime wrote: > Hi, > following up on this, Even replied to the thread noting that in OGR there > is no distinction between > linestring and multilinestring, and that one can force the creation of > multi geometries

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-21 Thread Andrea Aime
Hi, following up on this, Even replied to the thread noting that in OGR there is no distinction between linestring and multilinestring, and that one can force the creation of multi geometries by a parameter in ogr2ogr. Now, that still means many will get it wrong, because they may not be aware of

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-14 Thread Andrea Aime
Hi all, got confirmation from the spec lead that the GeoPackage is indeed invalid, quoting my question about mixing POLYGON and MULTIPOLYGON in the same table: Andrea, Your instincts are correct here. We're using the simple features rules for geometries and those do not provide a way to classify

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-13 Thread David Blasby
I fixed the Natural Earth GeoPKG just by changing the "POLYGON" to "MULTIPOLYGON" in the GEOPKG_GEOMETRY_COLUMNS table. QGIS is fine with this, and so is GeoServer (it will convert all the Polygons to Multipolygon - which is lossless). Not a great solution, but works fine... Dave On Wed, May

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-13 Thread Andrea Aime
On Wed, May 13, 2020 at 6:57 PM Jody Garnett wrote: > Andrea I am personally in favour of throwing an exception if the data is > inconsistent, but I respect that some data is not going to be fixed... > > Would a connection parameter work? Or were you thinking a system property > flag ... >

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-13 Thread Andrea Aime
Goin back to the original mail On Wed, May 13, 2020 at 2:12 AM David Blasby wrote: > > > Looking at the gpkg_geometry_column tables; > [image: image.png] > > We can see it's marked as "Polygon" (not multipolygon). > > During reading, we get to these lines; > > >

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-13 Thread Andrea Aime
On Wed, May 13, 2020 at 9:08 AM David Blasby wrote: > "Here, value [the variable] is a Multipolygon, but the binding is a > Polygon. The multipolygon is converted to a polygon, leading to the issues > above." > Yes, features in GeoTools are typed, if the feature type says POLYGON, converters

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-12 Thread Jody Garnett
Thanks for reporting to natural earth, from the geotools side this appears to be inconsistent data. I tend to prefer failing fast on any processing which could result in loss of data. That way we do not become part of the problem, only help identify the issue. Aside: A soft approach would be to

Re: [Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-12 Thread David Blasby
Oh - I reported the issue to the Natural Earth people - https://github.com/nvkelso/natural-earth-vector/issues/343 On Tue, May 12, 2020 at 5:11 PM David Blasby wrote: > Hi, > > I was trying to use the Natural Earth GeoPackage (countries) - link below. > > However, I found the rendering was very

[Geotools-devel] GeoPKG - issue with determining Geometry type (polygon vs multipolygon)

2020-05-12 Thread David Blasby
Hi, I was trying to use the Natural Earth GeoPackage (countries) - link below. However, I found the rendering was very "wrong"; [image: image.png] This triangle is actually 3 small islands - it's represented in the GeoPackage as a Multipolygon (one polygon for each island). This works fine in

Re: [Geotools-devel] geopkg issue

2020-03-10 Thread Jody Garnett
Thanks David, reviewing now - I have some questions we can discuss on the ticket. (My own understanding of geopackage is no doubt the limiting factor here) -- Jody Garnett On Tue, 10 Mar 2020 at 14:17, David Blasby wrote: > I put together a pull request - very minor change. I also put in a

Re: [Geotools-devel] geopkg issue

2020-03-10 Thread David Blasby
I put together a pull request - very minor change. I also put in a test case that messes with the timezone -- hopefully this will make sure this doesn't happen again. https://github.com/geotools/geotools/pull/2837 Thanks for the help/ideas/code Andrea! Couldn't have done it without you! dave

Re: [Geotools-devel] geopkg issue

2020-03-10 Thread Andrea Aime
I've found the flags related to local date handling: https://github.com/geotools/geotools/blob/029dc5c8ccc503de3cfd7f4d1c939d8056c260c4/modules/library/metadata/src/main/java/org/geotools/util/factory/GeoTools.java#L239

[Geotools-devel] geopkg issue

2020-03-10 Thread David Blasby
I'll look into the problem this afternoon. The timezone handling in sql lite is very limited and confusing. Cheers, David ___ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel

Re: [Geotools-devel] geopkg issue with featureentry name

2019-10-29 Thread andrea antonello
>> Hi, I am facing a problem with geopkg that I am not able to understand. >> >> Given the documentation I can insert features like this: >> >> FeatureEntry entry = new FeatureEntry(); >> geopkg.add(entry, featureCollection); >> >> To define the table name, I tried to set it in the FeatureEntry

Re: [Geotools-devel] geopkg issue with featureentry name

2019-10-28 Thread Andrea Aime
On Fri, Oct 25, 2019 at 12:41 PM andrea antonello < andrea.antone...@gmail.com> wrote: > Hi, I am facing a problem with geopkg that I am not able to understand. > > Given the documentation I can insert features like this: > > FeatureEntry entry = new FeatureEntry(); > geopkg.add(entry,

[Geotools-devel] geopkg issue with featureentry name

2019-10-25 Thread andrea antonello
Hi, I am facing a problem with geopkg that I am not able to understand. Given the documentation I can insert features like this: FeatureEntry entry = new FeatureEntry(); geopkg.add(entry, featureCollection); To define the table name, I tried to set it in the FeatureEntry before passing it in