Bulk Insert GeoJSON from Postgresql

All,

It's relatively simple to get spatial data from Postgres. The
following example is geojson exported directly from Postgis.

http://pastebin.com/25NsAteH

What would I have to do to bulk load the data in to ES?

Thanks in advance,
Adam

First, you will need to create an index, and have geo_type mapping on at
least the geometry.coordinates (see
Elasticsearch Platform — Find real-time answers at scale | Elastic).

Then you will need to use your favorite lang to read the data from the
database and index it into elasticsearch.

On Mon, Aug 1, 2011 at 9:01 PM, Adam Estrada estrada.adam@gmail.com wrote:

All,

It's relatively simple to get spatial data from Postgres. The
following example is geojson exported directly from Postgis.

GeoJSON 2 ElasticSearch - Pastebin.com

What would I have to do to bulk load the data in to ES?

Thanks in advance,
Adam

I literally have no idea how to get this in to ES. It's properly
formatted GeoJSON from OGR2OGR. Any tips on bulk loading this would be
great!

{
"type":"FeatureCollection",
"features":[{
"type":"Feature",
"properties":{
"id":1376628261,
"owner":"62311807@N05",
"secret":"f9a4598e7d",
"server":5109,
"farm":6,
"title":"Relax.",
"accuracy":11,
"place_id":"_cv6vY5WV7_DBdU",
"woeid":755126,
"translated":"Relax ",
"tags":"",
"date_taken":"2010/07/22",
"url":"Explore | Flickr
62311807@N05/5671595557/",
"description":"",
"photo_url":"http://farm6.static.flickr.com/
5109/5671595557_f9a4598e7d_z.jpg",
"date_inserted":"2011/07/24"
},
"geometry":{
"type":"Point",
"coordinates":[-3.293151,
36.940974
]
}
}
]
}

On Aug 1, 2:01 pm, Adam Estrada estrada.a...@gmail.com wrote:

All,

It's relatively simple to getspatialdata from Postgres. The
following example is geojson exported directly from Postgis.

GeoJSON 2 ElasticSearch - Pastebin.com

What would I have to do to bulk load the data in to ES?

Thanks in advance,
Adam

Ahh,

Thanks Shay! I was hoping to use the bulk loader like Sophia did here.

That would be perfect. Otherwise I suppose it would be easy enough to
script this in to ES.

Adam

On Aug 1, 4:59 pm, Shay Banon kim...@gmail.com wrote:

First, you will need to create an index, and have geo_type mapping on at
least the geometry.coordinates (seehttp://www.elasticsearch.org/guide/reference/mapping/geo-point-type.html).

Then you will need to use your favorite lang to read the data from the
database and index it into elasticsearch.

On Mon, Aug 1, 2011 at 9:01 PM, Adam Estrada estrada.a...@gmail.com wrote:

All,

It's relatively simple to get spatial data from Postgres. The
following example is geojson exported directly from Postgis.

GeoJSON 2 ElasticSearch - Pastebin.com

What would I have to do to bulk load the data in to ES?

Thanks in advance,
Adam

elasticsearch has a REST API and a built in Java API. If you want to use the
REST API, then I suggest using one of the client libs listed here:
Elasticsearch Platform — Find real-time answers at scale | Elastic.

I suggest, if you want to get familiar with elasticsearch in a very high
level, to go through the README on the github project and use curl to work
with it: GitHub - elastic/elasticsearch: Free and Open, Distributed, RESTful Search Engine.

On Tue, Aug 2, 2011 at 12:03 AM, Adam Estrada estrada.adam@gmail.comwrote:

I literally have no idea how to get this in to ES. It's properly
formatted GeoJSON from OGR2OGR. Any tips on bulk loading this would be
great!

{
"type":"FeatureCollection",
"features":[{
"type":"Feature",
"properties":{
"id":1376628261,
"owner":"62311807@N05",
"secret":"f9a4598e7d",
"server":5109,
"farm":6,
"title":"Relax.",
"accuracy":11,
"place_id":"_cv6vY5WV7_DBdU",
"woeid":755126,
"translated":"Relax ",
"tags":"",
"date_taken":"2010/07/22",
"url":"Explore | Flickr
62311807@N05/5671595557/",
"description":"",
"photo_url":"http://farm6.static.flickr.com/
5109/5671595557_f9a4598e7d_z.jpg",
"date_inserted":"2011/07/24"
},
"geometry":{
"type":"Point",
"coordinates":[-3.293151,
36.940974
]
}
}
]
}

On Aug 1, 2:01 pm, Adam Estrada estrada.a...@gmail.com wrote:

All,

It's relatively simple to getspatialdata from Postgres. The
following example is geojson exported directly from Postgis.

GeoJSON 2 ElasticSearch - Pastebin.com

What would I have to do to bulk load the data in to ES?

Thanks in advance,
Adam