geospatial

Help plotting Geographic Data in R using PBSMapping and Shapefiles

核能气质少年 提交于 2019-12-06 02:19:28
问题 Using O'Reilly's Data Mashups in R as inspiration, I'm trying to plot a handful of addresses on a shapefile of Salt Lake County, Utah found here. I have data frame geoTable: > geoTable address Y X EID 1 130 E 300 S 40.76271 -111.8872 1 2 875 E 900 S 40.74992 -111.8660 2 3 2200 S 700 E 40.72298 -111.8714 3 4 702 E 100 S 40.76705 -111.8707 4 5 177 East 200 S 40.76518 -111.8859 5 6 702 3rd ave 40.77264 -111.8683 6 7 2175 S 900 E 40.72372 -111.8652 7 8 803 E 2100 S 40.72556 -111.8680 8 And I've

Geotools: bounding box for a buffer in wgs84

旧街凉风 提交于 2019-12-06 02:14:21
I am need a Java function that will generate a bounding box (rectangle) around a buffer. The buffer is defined by the center point (WGS84 coordinate) and the radius (in meters). Getting a bounding box for a buffer in JTS seems to be quite simple: Point center = .... Geometry boundingBox = center.buffer(...).getEnvelope(); This however is pure planar geometry. Is there a way to do this using a coordinate reference system with the distance given in meters? Optimally with Geotools but other Java solutions will also work... Although you have approached it in another way, I have another solution

keep region names when tidying a map using broom package

橙三吉。 提交于 2019-12-06 00:06:06
I am using the getData function from the raster package to retrieve the map of Argentina. I would like to plot the resulting map using ggplot2, so I am converting to a dataframe using the tidy function from the broom package. This works fine, but I can't figure out how to preserve the names of the federal districts so that I can use them on the map. Here is my original code that does not preserve the district names: # Original code: ################################## # get the map data from GADM.org and then simplify it arg_map_1 <- raster::getData(country = "ARG", level = 1, path = "./data/")

MongoDB geospatial query with $not

耗尽温柔 提交于 2019-12-05 23:01:22
问题 I have a basic geospatial query working well in MongoDB. It seems that it should be easy to apply $not to get the complement... but it's not working for me. Is it simple user error? Or can MongoDB not handle this query conceptually? I could not find any such limitation in the documentation. Working query (correctly finds the 2 cities within 10 miles of the center): db.customers.find({ "location" : { $within : { $center : [[-117.15,32.72],0.15] } } }) Attempted complement query (desired result

Geospatial Indexing with a simple key first

心不动则不痛 提交于 2019-12-05 22:48:44
After reading about MongoDB and Geospatial Indexing I was amazed that it did not support compound keys not starting with the 2d index. I dont know if I would gain anything on it, but right now the mssql solution is just as slow/fast. SELECT TOP 30 * FROM Villages WHERE SID = 10 ORDER BY (math to calc radius from the center point) This works, but is slow because it not smart enough to use a index so it has to calc the radius for all villages with that SID. So in Mongo I wanted to create an index like: {sid: 1, loc: "2d"} so I could filter out alot from the start. I'm not sure there are any

What are some recommended frameworks for manipulating spatial data in C++? [closed]

徘徊边缘 提交于 2019-12-05 22:45:42
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . What are some recommended frameworks for manipulating spatial data in C++? I'm looking for a polygon object, point object, and some

Is there a reason that Cassandra doesn't have Geospatial support?

一曲冷凌霜 提交于 2019-12-05 21:57:12
问题 Since Cassandra is based off of the Dynamo paper (distributed, self-balancing hash table) + BigTable and there are spatial indexes that would fit nicely into that paradigm (quadkey or geohash). Is there a reason that Geospatial support hasn't been implemented? You could add a GeoPoint datatype as a tuple with an internal geohash and specify a CF as containing geo data. From there you can choose the behavior as having the geo data being a secondary index, or a denormalized SCF. That could lay

Removing data outside country map boundary in R

眉间皱痕 提交于 2019-12-05 20:17:09
I know this is simple but could get this working. I want to remove the excess data points on the map below. How do i do it? Below code gave me the results. ggplot() + geom_polygon(data = rwa2, aes(x = long, y = lat, group= group), colour = "black", size = 0.5, fill = "white") + geom_tile(data = df, aes(x = Lon, y = Lat, z = z, fill = z), alpha = 0.8) + ggtitle("State Data") + xlab("Longitude") + ylab("Latitude") + scale_fill_distiller(type = "div", palette = "Spectral")+ theme_bw() + theme(plot.title = element_text(size = 25, face = "bold"), legend.title = element_text(size = 15), axis.text =

Sunspot geospatial search ERROR:unknown field 'location_ll'

ⅰ亾dé卋堺 提交于 2019-12-05 20:01:28
I've been trying to integrate geospatial search into my rails app for a few days now, but keep getting this error when I run rake sunspot:solr:reindex RSolr::Error::Http - 400 Bad Request Error: ERROR:unknown field 'location_ll' Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Place 1</field><field name=\"type\">Place</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Place</field><field name=\"location_ll\">42.348065,-71.083623</field></doc> #etc... keeps going on for all the objects/fields being indexed in the table As far as

MongoDB: Geospatial Index array not in correct format

橙三吉。 提交于 2019-12-05 19:42:57
While trying to setup to use the Geospatial Index on MongoDB, I run into the error message that the location array is not in the correct format. This is my collection "test". { "_id" : ObjectId("4f037ac176d6fdab5b00000a"), "CorporateId" : "XYZ12345", "Places" : [ { "Location" : { "Longitude" : "50.0", "Latitude" : "50.0" }, "ValidFrom" : "2011-11-01 00:00:00", "ValidTo" : "2021-12-31 00:00:00", "itemCount" : "1" } ] } Once I run this code. db.test.ensureIndex({"Places.Location": "2d"}); I get this error message location object expected, location array not in correct format My assumption is