1

I am trying to import a geojson file with the US States. The geojson file has 3 fields. gid,state_abbr, and geometry.

I submit this code

bin/geomesa-cassandra ingest --contact-point 127.0.0.1:9042 --key-space mykeyspace --catalog mycatalog --converter state-json --spec state-json states.geojson

and get back

INFO  Creating schema state-json
INFO  Running ingestion in local mode
INFO  Ingesting 1 file with 1 thread
[                                                            ]   0% complete 
0 ingested 57 failed in 00:00:01
INFO  Local ingestion complete in 00:00:01
INFO  Ingested 0 features and failed to ingest 57 features.

My converter file is

"state-json" = {
  type         = "json"
  id-field     = "$gid"
  feature-path = "$.features"
  fields = [
    { name = "gid",   json-type = "integer",  path = "$.gid",             }
    { name = "state_abbr", json-type = "string",   path = "$.state_abbr", }
    { name = "geom",  json-type = "geometry", path = "$.geometry",    }
  ]
}

and my spec file is

"state-json" = {
  attributes = [
    { name = "gid", type = "Integer"    }
    { name = "state_abbr",  type = "String" }
    { name = "geom",   type = "Geometry"  }
  ]
}

Is there anything I am doing wrong?

2

There are a few things to try:

First, for the paths, GeoJSON has a 'properties' bit in the path. That'll mean that the gid might be '$.properites.gid', etc.

Next, since 'gid' is an integer, and id's are strings, you'll want to do id-field = "toString($gid)".

Lastly, to debug more, can you peek at logs/geomesa.log?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.