Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] ingesting and exposing polygon data, is this supported?

Emilio,

So I was trying this against a geomesa 1.2.3 instance over accumulo 1.6.2.  

I question what if anything ingested into the tables.  I need to add logging to the ingester to see if the insert of the first batch really did complete.  I had assumed it did get something in but I will verify if anything made it in next week.

Behavior was from GeoServer it could connect to the store, it was able to pull the schema I defined, it was able to determine some sort of bounding box for the data though I question what got filled out for that.  But no data would display in the layer preview.  

I also did not see a z3 table created so I started suspecting ingest did not happen but I did not see anything wrong with instead of creating a point, make it a polygon.  

I'll check out the test to try and replicate what it is doing as a smoke test against my instance and add more logging to my ingest process.

Thanks,
Diane

From: Emilio Lahr-Vivaz <elahrvivaz@xxxxxxxx>
Reply-To: "geomesa-users@xxxxxxxxxxxxxxxx" <geomesa-users@xxxxxxxxxxxxxxxx>
Date: Friday, July 1, 2016 3:17 PM
To: "geomesa-users@xxxxxxxxxxxxxxxx" <geomesa-users@xxxxxxxxxxxxxxxx>
Subject: Re: [geomesa-users] ingesting and exposing polygon data, is this supported?

Hi Diane,

What behavior are you observing?

What you're doing should work fine, and we have lots of unit tests that use polygon shapes. They're written in scala, but for example:

https://github.com/locationtech/geomesa/blob/master/geomesa-accumulo/geomesa-accumulo-datastore/src/test/scala/org/locationtech/geomesa/accumulo/data/AccumuloDataStoreFilterTest.scala

(in this test the binding is a generic geometry - you should stick with Polygon if that is your shape)

One way to check that the geometry is being set correctly is to print out the attribute from the simple feature after setting it. Usually geotools will convert it to the correct type, and if it can't do so the attribute will be null, e.g.

SimpleFeature feature = featureBuilder.build();
System.out.println(feature.getAttribute(polyFieldName));

I also find this website useful for checking WKT syntax:

http://arthur-e.github.io/Wicket/sandbox-gmaps3.html

Thanks,

Emilio

On 07/01/2016 02:58 PM, Diane Griffith wrote:

I am trying to debug if I ingested polygon data correctly.  I’d like to ingest a polygon and expose it via geomesa/geoserver. 

 

Is there a trick to this as I am not sure it actually created the indexes expected. 

 

I was going to have the regular point data and then have a separate data set that had the associated polygons to turn them on and off.

 

I defined a field of *polygonField:Polygon:srid=4326 in the schema.  I then created  a polygon via geotools out of arrays of points to insert with the feature data.

 

(i.e. one way I tried was using the following classes:

 

WKTReader reader = new WKTReader(geometryFactory);

String coordinates=”///arrays of  point values///”

StrinBuffer polyStringBuffer=new StringBuffer(“POLYGON((“).append(coordinates).append(“))”);

 

Polygon polygon = (Polygon) reader.read(polyStringBuffer.toString());

 

featureBuilder.set(polyFieldName, polygon);

 

…)

 

I had tried a coorindates array as well and using LinearRing and then using that to create the Polygon.

 

Did I need to mess with any underlying indexes or am I out of luck of ingesting them in via geomesa and exposing them through geoserver.  So in this case I don’t put in the associated point with the polygon, is that a potential problem area?  If there is a good example to better understand how to do something similar I’d love to review it. 

 

Thanks,

Diane



_______________________________________________
geomesa-users mailing list
geomesa-users@xxxxxxxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.locationtech.org/mailman/listinfo/geomesa-users


Back to the top