PostGIS

Add distance to a particular latitude/longitude position

荒凉一梦 提交于 2019-12-12 09:22:08
问题 Rails 4 + Postgres. New to geospatial. Happy to accept solutions that involve RGeo, Geokit, Geocoder, or any other gem that helps solve this issue. Model contains two fields latitude and longitude . I have an offset attribute that contains a distance in meters and an orientation attribute that contains one of the 4 cardinal directions (N, E, W, S). Example: offset: 525.5 orientation: W What's a standard way of adding the offset distance to the lat-long position, to give me a new lat-long pair

Dump or restore Postgresql databases without Postgis functions

…衆ロ難τιáo~ 提交于 2019-12-12 08:10:10
问题 I want to dump 4 databases from postgresql 8.4 to migrate to Postgresql 9.1. I use PostGis on the old Postgresql 8.4 with PgRouting so each database has around 1000 functions. Each time I export all databases, all functions are written in the dump. When I restore the backup file, I get some conflicts when I create an extension of postgis or pgrouting on Postgresql 9.1 Is there anyway to dump databases on 8.4 (create dbs, create schemas, create tables and data) without exporting fucntions as

Error was: cannot import name 'GDALRaster' in windows 8.1

旧巷老猫 提交于 2019-12-12 06:21:49
问题 It's not my answer. Because I am trying to develop in windows 8.1 64bit: http://stackoverflow.com/questions/39037351/django-migration-cant-find-gdalraster (casino_locater) C:\Users\....\Desktop\Geolocation>python manage.py makemigrations ............. .............. .............. django.core.exceptions.ImproperlyConfigured: 'django.contrib.gis.db.backends.postgis' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql',

Points in Polygon, multiple polygons

大兔子大兔子 提交于 2019-12-12 04:49:26
问题 I have this query working where I populated the prem_council column in my dst db by matching points with polygons in the src. But, I could only do it manually by stepping through each district 1-15 manually. UPDATE poursafe.ca_licenses dst SET prem_council = '1' FROM ca_la_la_areas_council_dist_2012 src WHERE EXISTS ( SELECT * FROM public.ca_la_la_areas_council_dist_2012 src WHERE ST_Within(dst.geom, src.geom ) AND district = '1' ); I can't figure out how and wonder if you can tell me how I

JPA can't convert PostgreSQL POINT type

时光怂恿深爱的人放手 提交于 2019-12-12 04:38:25
问题 I am in the process converting an existing Spring project to JPA/Jinq. One of my database columns is using the PostGIS geometry POINT type. I am mapping the table for that column to an entity called City. The class for that something like this: import java.io.Serializable import javax.persistence.*; import org.postgresql.geometric.PGpoint; @Entity @NamedQuery(name="City.findAll", query="SELECT c FROM City c") public class City implements Serializable { private static final long

Importing a PostGIS geometry type into Python as a geometry type from Shapely?

落爺英雄遲暮 提交于 2019-12-12 04:36:32
问题 So I have a situation where I have a ton of Linestrings of a broken up route, where I need to Union them together using Shapely's LineMerge or Union OR PostGIS ST_Union. My idea right now is to use Shapely to import the Linestrings as Geometry types. Union them or merge them using Shapely, and then export back to a results table in the database. However, the geometry type in the PostGIS database is just a bunch of gibberish. Like... 01020000020e61000.... How can I translate this from the

How to query all shops around a certain longitude/latitude using osm-postgis?

删除回忆录丶 提交于 2019-12-12 00:16:51
问题 I loaded the map of city Munich (from openstreetMap) into postgis with tool osm2pgsql -s modus now how could I get all shops around a certain point, say (a,b), within 100 meters, in a most efficient way I know it is something like select name, shop from planet_osm_point where ST_DWithin(? ,ST_Point(a,b):geometry, 100) thanks a lot 回答1: You query is already a correct and efficient way to query the data you need. You only need one adjustments: The function St_Point returns a geometry without

GeoServer发布Shapfile、PostGIS数据

一个人想着一个人 提交于 2019-12-12 00:11:05
GeoServer发布Shapfile、PostGIS数据 一、GeoServer发布Shapfile数据 1.1 创建工作区 1.1.1 工作区 1.2 在工作区中加入新的数据存储 1.2.1 数据存储 1.3 发布图层 1.4 预览图层 二、GeoServer发布PostGIS中的数据 相关博文原文地址: CSDN:不睡觉的怪叔叔: 使用GeoServer发布Shapfile数据 CSDN:不睡觉的怪叔叔: 使用GeoServer发布PostGIS中的数据 一、GeoServer发布Shapfile数据 浏览器进入:http://localhost:8084/geoserver/web/ 界面。 进入Geoserver的Web管理页面。在Geoserver的Web管理页面中输入用户名与密码进行登录。如果是默认安装,那么用户名为"admin",密码为"geoserver"。 1.1 创建工作区 在GeoServer中发布和部署地图数据涉及到的几个重要概念—— 工作区(WorkSpace)、数据存储(Store)和图层组 等。 1.1.1 工作区 工作区 (有时又称为命名空间)是一个用于组织类似图层数据(数据集)的容器。常常会把某个项目或工程的相关图层数据存放到一个工作区里。通过工作区的使用,可以避免相同图层名的冲突。例如,在名为beijing工作区中的streets图层

Overlapping box with infinite edge coordinate

狂风中的少年 提交于 2019-12-11 19:46:42
问题 I try to understand how does overlapping box with infinity works Why does the following exemple doesn't work. It works fine except when i try to introduce two infinite values. This exemple should return true. SELECT box '((1,1),(infinity, 1))' && box '((2, 1),(infinity, 1))' AS overlap; overlap --------- f The two exemples below works SELECT box '((1,1),(4, 1))' && box '((2, 1),(infinity, 1))' AS overlap; overlap --------- t SELECT box '((1,1),(4, 1))' && box '((2, 1),(5, 1))' AS overlap;

Postgres Database Local Installation / Running

為{幸葍}努か 提交于 2019-12-11 19:42:01
问题 Trying to setup Postgres / PostGIS on OSX Mountain Lion to use with Django. However, something is wrong and I am not sure how to fix it. $ createdb geo createdb: could not connect to database postgres: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? $ postgres -D /usr/local/var/postgres FATAL: lock file "postmaster.pid" already exists HINT: Is another postmaster (PID 221)