I'm a newbie on rails and tried using Rgeo and GeoJSON.
I want to extract GeoJSON from my data to use in leaflet.
What is the proper way to install GeoJSON (and/or place).
Gemfile :
gem 'activerecord-postgis-adapter'
gem 'rgeo-geojson'
gem…
I want to output a geojson file from my rails app using rgeo-geojson. I have a table of points each with lat and long.
I have my controller set up in the standard way
respond_to do |format|
format.html
format.csv { send_data…
I want to save a polygon.
This is Geojson enter link description here
str1 = "geojson....."
geom = RGeo::GeoJSON.decode(str1, json_parser: :json)
l = Limit.new
l.multipoligono = geom
l.save
NoMethodError: undefined methodfactory' for…
I am a beginner in rails framework, so please pardon my naive question. I have a google.maps.Data.MultiPolygon object on my frontend which I want to save in my database. The table searches creates a new entry everytime a user searches, contains…
I am trying to get all polygons that are within leaflet map boundaries. No need to bother about leaflet, the question is more about rgeos or other methods (or primarily about correct function). I tried variety of methods and they work OK if shapes…
I've got the beginnings of a spatial app (PostGIS + Rails + RGeo) with a single line_string column on one of my models. On my local machine everything is good, the problem is on Heroku web dynos, where Rails/activerecord doesn't recognise the…
I have the following scope I've gotten to work with raw SQL:
class DeliveryZone < ActiveRecord::Base
def self.contains(addressable)
point = addressable.lonlat
where(<<-SQL.squish)
ST_Intersects("delivery_zones"."shape",…
I, unfortunately, upgraded to postgis to 2.2.0 via homebrew and am now getting the errors below. I would go back to 2.1.0 but the formula doesn't seem to be available anymore. Going to 2.0 tries to downgrade Postgres to 9.2.
Any thoughts on what…
When I run this command in rails:
CensusBlockGroup.where{st_interects(:the_geom, buffer)}
which runs this command in SQL:
SELECT "census_block_groups".* FROM "census_block_groups" WHERE (st_intersects("census_block_groups"."proj_shape_3361",…
The application is based on PostGIS and stores data using RGeo's simple_mercator_factory.
Polygon records are created and associations with points are static (i.e. don't need updating). To reduce overhead on postGIS calculations, it makes sense to…
I'm having an issue when retrieving the value of a geometry column from the database. I save an RGeo::Cartesian::PolygonImpl instance, reload the record, and when I retrieve the value, I get a String instead of a Geometry.
My config/database.yml…
I have a device reporting its position to me in a format they describe as 'ddmm.mmmm'
it looks like this:
Latitude: 5108.5837 N
Longitude: 00052.6334 E
Anyone have an idea how I can convert this to a normal decimal number that I can use with RGeo?
I'm using activerecord-postgis-adapter to save (latitude, longitude) values as POINTs. Points are saved using the following syntax: POINT( lat lng). My model, Foo, has an attribute spot, where the POINT is saved. When deployed to Heroku, spot is…
I'm converting a KML file to a polygon stored on my database thanks to RGeo
I need the centroid: @area.centroid and I would like to find the approximative radius on my shape.
I don't know if it's possible. My database field is a geometry. That means…
I've got a really weird bug that I hope someone here can help with. I've imported a shape file into my rails postgis database. It contains the following columns:
search
source
search2
dups
geom
The geom column contains an RGeo MultiPolygon…