Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [geomesa-users] Coordinate Reference System in Accumulo

Thanks Jim,

 

This is good to know before I spend any more time trying to figure it out.

 

Reprojecting the data is not ideal, but now that I know that it is necessary I can plan for it. If I can’t figure out how to use GeoTools to do this, I will get back to you.

 

As for contributing my updates, they are not in a state for this. I simply made a separate tool that is Java only. I did not modify the Geomesa scala version. I am new to scala. I was able to follow along and figure out what it was doing, but I need to learn more before I contribute. But I certainly am open to this in the future.

 

From: geomesa-users-bounces@xxxxxxxxxxxxxxxx [mailto:geomesa-users-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Jim Hughes
Sent: Wednesday, February 24, 2016 4:27 PM
To: geomesa-users@xxxxxxxxxxxxxxxx
Subject: Re: [geomesa-users] Coordinate Reference System in Accumulo

 

Hi Nathan,

As a quick response, GeoMesa indexes vector data in WGS84.  While this is limitation, it is one which rarely find insurmountable.

Are there any issues with reprojecting your data?  If not, then we just need to sort out the details of using GeoTools to convert your feature data from NAD83 to WGS84.  Shout if that's possible, and I'd be willing to help run down some GeoTools example code.

Cheers,

Jim

p.s.  If you are willing to contribute these updates, I'd be happy to help encourage that!  Generally, I'm in full support of both ingesting multiple shapefiles from the commandline and handling the basic transformations to WGS84 for users.

We have a few details about contributing here: https://github.com/locationtech/geomesa/blob/master/CONTRIBUTING.md.

On 02/24/2016 06:19 PM, Nathan Mercer wrote:

I have written a simple tool to ingest shapefiles into Accumulo. I know that this already exists through the geomesa ingest tool. However, it is limited. It only does one file at a time. I know that I can batch it in a script, but this doesn’t work either. I want to ingest a large set of shapefiles into a single feature within a single Accumulo table. The geomesa ingest tool will not append to an existing feature. So it won’t work.

 

Therefore, I have simply looked at what the geomesa ingest tool does and I tried to mimic it. It works great except for one thing. I am having problems with the coordinate reference system.

 

I am essentially doing the following:

 

1.       Connect to the Accumulo database. If the table does not exist already it will be created. I get an AccumuloDataStore out of this.

AccumuloDataStore dataStore = (AccumuloDataStore)DataStoreFinder.getDataStore(connectionInfo);

 

For each shapefile in a folder.

 

1.       Create a SimpleFeatureCollection from the shapefile

2.       Get the Schema (SimpleFeatureType) from the SimpleFeatureCollection

3.       Get a SimpleFeatureStore from the AccumuloDataStore. If this fails (I assume because the feature did not already exist in the database) then I create the feature using dataStore.createSchema(shapefileSchema) before getting the feature source.

SimpleFeatureStore featureStore = (SimpleFeatureStore)dataStore.getFeatureSource(featureName);

4.       Add the shapefile features to the featureStore.

((AccumuloFeatureStore)featureStore).addFeatures(shapefileFeatures);

 

Now this all works if the .prj files specify the CRS as WGS84 geographic which is apparently the default.

 

However, I have shapefiles that are geographic NAD83. I can tell that the first two steps that I do for the shapefile are working because when I print out the result of shapefileSchema.getCoordinateReferenceSystem().toWKT()  I can see that it gives me NAD83 as I expect.

 

The problem is that after I go through all 4 steps with the first shapefile and then get back, the next shapefile fails on step 4. It says that there is a mismatch of the Coordinate Reference Systems.

 

Sure enough, if I print out the reference system after step 3 using featureStore.getSchema().getCoordinateReferenceSystem().toWKT() it says that it is WGS84.

 

This shows me that either the getFeatureSource in step 3 is not pulling the CRS from Accumulo, or the addFeatures in step 4 is not adding the CRS to Accumulo. Therefore, my code thinks that no matter what the CRS was in the shapefiles the CRS is WGS84 in Accumulo.

 

Anybody have any idea what is going on here?

 

Note: I am using Geomesa 1.1.0-rc.5 with Accumulo 1.6.1

 

Thanks,

Nathan Mercer


  ­­  


_______________________________________________
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