Importing geospatial data into Redis
up vote
0
down vote
favorite
I have several shapefiles that I would like to import into several databases in order to measure the performance of queries, one of them is Redis. I tried to convert shapefile to CSV format, but I'm stuck on it.
Here is an example of a fragment of such a CSV file (builtups.csv):
student@student:~/Downloads/json/csv$ head -2 < builtups.csv
WKT,cat,NAME,F_CODE
"POLYGON ((-1381208.93176959 4018867.04896281,-1381545.4605916 4020028.58540091,-1379543.95554302 4021140.67154976,-1379854.59452705 4021569.00939107,-1380453.82420181 4021984.78053386,-1380620.70731434 4022565.37636904,-1377122.99898975 4022708.4072678,-1376019.8736383 4020549.48804913,-1381208.93176959 4018867.04896281))",1,BETHEL,Built-Up Area
Another example:
student@student:~/Downloads/json/csv$ head < popp.csv
WKT,cat,F_CODEDESC,F_CODE,TYPE
"POINT (-1049809.14913148 6635460.69190277)",1.000,Building,AL015,CABIN
"POINT (441308.810636207 6573953.19546494)",2.000,Building,AL015,CABINS
"POINT (340199.412944192 6540038.90039579)",3.000,Building,AL015,CABIN
"POINT (191579.478604275 6529955.3502767)",4.000,Building,AL015,CABIN
Does Redis geo have the capability for storing polygons? If yes, how to import those CSV files to Redis? If not, how do I avoid the problem?
database csv redis geospatial shapefile
New contributor
add a comment |
up vote
0
down vote
favorite
I have several shapefiles that I would like to import into several databases in order to measure the performance of queries, one of them is Redis. I tried to convert shapefile to CSV format, but I'm stuck on it.
Here is an example of a fragment of such a CSV file (builtups.csv):
student@student:~/Downloads/json/csv$ head -2 < builtups.csv
WKT,cat,NAME,F_CODE
"POLYGON ((-1381208.93176959 4018867.04896281,-1381545.4605916 4020028.58540091,-1379543.95554302 4021140.67154976,-1379854.59452705 4021569.00939107,-1380453.82420181 4021984.78053386,-1380620.70731434 4022565.37636904,-1377122.99898975 4022708.4072678,-1376019.8736383 4020549.48804913,-1381208.93176959 4018867.04896281))",1,BETHEL,Built-Up Area
Another example:
student@student:~/Downloads/json/csv$ head < popp.csv
WKT,cat,F_CODEDESC,F_CODE,TYPE
"POINT (-1049809.14913148 6635460.69190277)",1.000,Building,AL015,CABIN
"POINT (441308.810636207 6573953.19546494)",2.000,Building,AL015,CABINS
"POINT (340199.412944192 6540038.90039579)",3.000,Building,AL015,CABIN
"POINT (191579.478604275 6529955.3502767)",4.000,Building,AL015,CABIN
Does Redis geo have the capability for storing polygons? If yes, how to import those CSV files to Redis? If not, how do I avoid the problem?
database csv redis geospatial shapefile
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have several shapefiles that I would like to import into several databases in order to measure the performance of queries, one of them is Redis. I tried to convert shapefile to CSV format, but I'm stuck on it.
Here is an example of a fragment of such a CSV file (builtups.csv):
student@student:~/Downloads/json/csv$ head -2 < builtups.csv
WKT,cat,NAME,F_CODE
"POLYGON ((-1381208.93176959 4018867.04896281,-1381545.4605916 4020028.58540091,-1379543.95554302 4021140.67154976,-1379854.59452705 4021569.00939107,-1380453.82420181 4021984.78053386,-1380620.70731434 4022565.37636904,-1377122.99898975 4022708.4072678,-1376019.8736383 4020549.48804913,-1381208.93176959 4018867.04896281))",1,BETHEL,Built-Up Area
Another example:
student@student:~/Downloads/json/csv$ head < popp.csv
WKT,cat,F_CODEDESC,F_CODE,TYPE
"POINT (-1049809.14913148 6635460.69190277)",1.000,Building,AL015,CABIN
"POINT (441308.810636207 6573953.19546494)",2.000,Building,AL015,CABINS
"POINT (340199.412944192 6540038.90039579)",3.000,Building,AL015,CABIN
"POINT (191579.478604275 6529955.3502767)",4.000,Building,AL015,CABIN
Does Redis geo have the capability for storing polygons? If yes, how to import those CSV files to Redis? If not, how do I avoid the problem?
database csv redis geospatial shapefile
New contributor
I have several shapefiles that I would like to import into several databases in order to measure the performance of queries, one of them is Redis. I tried to convert shapefile to CSV format, but I'm stuck on it.
Here is an example of a fragment of such a CSV file (builtups.csv):
student@student:~/Downloads/json/csv$ head -2 < builtups.csv
WKT,cat,NAME,F_CODE
"POLYGON ((-1381208.93176959 4018867.04896281,-1381545.4605916 4020028.58540091,-1379543.95554302 4021140.67154976,-1379854.59452705 4021569.00939107,-1380453.82420181 4021984.78053386,-1380620.70731434 4022565.37636904,-1377122.99898975 4022708.4072678,-1376019.8736383 4020549.48804913,-1381208.93176959 4018867.04896281))",1,BETHEL,Built-Up Area
Another example:
student@student:~/Downloads/json/csv$ head < popp.csv
WKT,cat,F_CODEDESC,F_CODE,TYPE
"POINT (-1049809.14913148 6635460.69190277)",1.000,Building,AL015,CABIN
"POINT (441308.810636207 6573953.19546494)",2.000,Building,AL015,CABINS
"POINT (340199.412944192 6540038.90039579)",3.000,Building,AL015,CABIN
"POINT (191579.478604275 6529955.3502767)",4.000,Building,AL015,CABIN
Does Redis geo have the capability for storing polygons? If yes, how to import those CSV files to Redis? If not, how do I avoid the problem?
database csv redis geospatial shapefile
database csv redis geospatial shapefile
New contributor
New contributor
edited Nov 10 at 14:52
Mihai Chelaru
1,8297816
1,8297816
New contributor
asked Nov 10 at 13:37
Dominik Bartoszewski
11
11
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS and GEORADIUSBYMEMBER are the only Redis geo-related commands that I'm aware of, and none of them applies to polygons (except for the particular case of bounding boxes, and they are not stored anyway).
That said, nothing prevents you from storing WKT polygons as text strings, or, alternatively, convert the original shapefile polygons to GeoJson and store them as regular JSON objects via Rejson, a Json datatype for Redis,
https://github.com/redislabsmodules/rejson
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS and GEORADIUSBYMEMBER are the only Redis geo-related commands that I'm aware of, and none of them applies to polygons (except for the particular case of bounding boxes, and they are not stored anyway).
That said, nothing prevents you from storing WKT polygons as text strings, or, alternatively, convert the original shapefile polygons to GeoJson and store them as regular JSON objects via Rejson, a Json datatype for Redis,
https://github.com/redislabsmodules/rejson
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
add a comment |
up vote
0
down vote
GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS and GEORADIUSBYMEMBER are the only Redis geo-related commands that I'm aware of, and none of them applies to polygons (except for the particular case of bounding boxes, and they are not stored anyway).
That said, nothing prevents you from storing WKT polygons as text strings, or, alternatively, convert the original shapefile polygons to GeoJson and store them as regular JSON objects via Rejson, a Json datatype for Redis,
https://github.com/redislabsmodules/rejson
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
add a comment |
up vote
0
down vote
up vote
0
down vote
GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS and GEORADIUSBYMEMBER are the only Redis geo-related commands that I'm aware of, and none of them applies to polygons (except for the particular case of bounding boxes, and they are not stored anyway).
That said, nothing prevents you from storing WKT polygons as text strings, or, alternatively, convert the original shapefile polygons to GeoJson and store them as regular JSON objects via Rejson, a Json datatype for Redis,
https://github.com/redislabsmodules/rejson
GEOADD, GEODIST, GEOHASH, GEOPOS, GEORADIUS and GEORADIUSBYMEMBER are the only Redis geo-related commands that I'm aware of, and none of them applies to polygons (except for the particular case of bounding boxes, and they are not stored anyway).
That said, nothing prevents you from storing WKT polygons as text strings, or, alternatively, convert the original shapefile polygons to GeoJson and store them as regular JSON objects via Rejson, a Json datatype for Redis,
https://github.com/redislabsmodules/rejson
answered 2 days ago
lusitanica
1667
1667
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
add a comment |
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
If I convert to the Rejson format, is it possible to check if the point is included in the polygon? Something like ST_Contains or ST_Within in PostGIS?
– Dominik Bartoszewski
8 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
github.com/RedisLabs/geo.lua/blob/master/…
– lusitanica
4 hours ago
add a comment |
Dominik Bartoszewski is a new contributor. Be nice, and check out our Code of Conduct.
Dominik Bartoszewski is a new contributor. Be nice, and check out our Code of Conduct.
Dominik Bartoszewski is a new contributor. Be nice, and check out our Code of Conduct.
Dominik Bartoszewski is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239523%2fimporting-geospatial-data-into-redis%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password