Questions tagged [geography-data-type]

geography data type, stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Generate Points from inside SQL Geography

I have a shapefile which has been loaded into MS SQL-Server. Mostly polygons, but some multi-polygons as well. For each record, I need to generate a list of say 50 points that are within the polygon. ...
4
votes
1answer
61 views

Storing Central European data, which SRS/which data type?

I am creating a PostGIS 2.X data base to store some 500 or so sites as points in it, which are distributed in the northeastern part of Germany, northern Poland and parts of the southern Baltic coast. ...
6
votes
0answers
227 views

ST_Covers fails on GEOGRAPHY column with GiST index, PostGIS 3.0 [closed]

I'm trying to upgrade to Postgres 12 with PostGIS 3.0. Unfortunately, I can't get my spatial queries to work. There seems to be an issue using ST_Covers on a geography column with a GiST index. Proof ...
2
votes
1answer
59 views

Why is a “geography” type needed at all in PostGIS? [closed]

Let a and b be two points. ST_Distance(a, b) returns their distance. Instead of having two data types, geometry and geography, that practically overload the meaning of ST_Distance(), we could instead ...
4
votes
1answer
125 views

Finding all circles point lies in using PostGIS

Suppose you have a task to find all points within a certain radius. That's where you use ST_DWithin which is indexable and it will deal with it. My task is the opposite from that: I have a set of ...
2
votes
1answer
45 views

How to check for PostGIS Function Support Matrix for new custom EPSG imported from EPSG site

I need a support for CRS that was not available in PostGIS 2.5 so I looked up into the EPSG site they had simple easy straight forward insert query to add EPSG so I did that now how do I check or know ...
1
vote
0answers
105 views

SQL server 2012 convert Multipolygon geometry to geography - GDA94 / MGA zone 55 coordinate reference system

Is there a way to convert geometry column value which has GDA94 / MGA zone 55 coordinate reference system into Geography value in SQL server 2012. The layer is a multipolygon layer We were having the ...
1
vote
1answer
306 views

PostGIS view on multiple geometry columns

I have two PostGIS tables, ‘filelinks’ and ‘maricopa_plss_qtrqtrs’. The filelinks table has a geometry type column named ‘geom_p’ and the maricopa_plss_qtrqtrs has a geometry type column named ‘geom’. ...
2
votes
0answers
438 views

SP-GiST for geography type in PostGIS

This CREATE INDEX geography_gdx ON schema.table USING GIST (geog); works, but CREATE INDEX geography_gdx ON schema.table USING SPGIST (geog); gives me [42704] ERROR: data type geography has no ...
0
votes
1answer
915 views

Convert datatype in Google Earth Engine from double to integer [closed]

How can I convert a variable to another data type using Google Earth Engine? For example I've created a NDVI image in double number (interval value -1.0 to +1.0). I want to save the image in byte (...
1
vote
0answers
250 views

What is geometry(4326), and can you do Cartesian calculations with unprojected ellipsoidal coordinates?

I know Geography(4326) is an unbounded, and unprojected, and covers the entire world with ellipsoidal coordinates. I get that the math on this system is done on a spheroid. I also get that with a ...
0
votes
0answers
109 views

How to set the extent of a PostGIS geography table?

I have multiple geography tables in PostGIS database. All of them have extents of (-180,-90;180,90), probably in their metadata, which makes editing difficult. I'd like to set the extent to exactly ...
0
votes
1answer
258 views

Converting geography types in PostGIS? [duplicate]

I have multiple tables in different geography types. For example, some are Point, some are PointZM, some are MultiPoint, etc. I need to convert all of them to PointZ. I have searched the documentation ...
1
vote
1answer
392 views

Pulling Spatial Data in Geography Format From MS SQL Server 2008 Using ogr2ogr

Can the MSSQLSpatial driver support geography fields queried from MS SQL Server 2008 as spatial data? Background I have been using unixODBC on an Ubuntu 16.04 machine with ODBC Driver 17 for SQL ...
3
votes
1answer
1k views

SQL WKT draws well with geometry, but not with geography data type

I have a following piece of code DECLARE @g geometry; DECLARE @borders geography; SET @g = geometry::STGeomFromText('SOME WKT', 0); SET @borders = GEOGRAPHY::STGeomFromText(@g.MakeValid()....
0
votes
0answers
467 views

SQL Server - ESPG:4326 data stored in Geometry column

It seems that the Microsoft SQL Server Geography data type is better suited for lat/lon because Geography "stores ellipsoidal (round-earth) data, such as GPS latitude and longitude coordinates." ...
1
vote
1answer
2k views

How to Cast geometry to Geography in SQL script in MS SQL Server?

I have a Table with some spatial Data in MS SQL Server. The datatype of the spatial column is geometry. I'm trying to get the closest data from an input file using the following query: DECLARE @g ...
2
votes
0answers
526 views

SQL Geometry type and Geography type conversions/projections

I am working with a replica database managed in Sql Server Management Studio 2016. My geographic data of points, lines, and polygons are projected in WGS_1984_UTM_Zone_17N Meter and SRID of 32617. Its ...
0
votes
1answer
58 views

Saving borough boundaries as MultiLineStrings or MultiPolygons?

I am creating a database in PostGIS and I have a column that will save the boundaries of boroughs. The app will later query the database, asking what points, lines or polygons are inside those ...
8
votes
2answers
718 views

Is PostGIS geography type EPSG:4326 only?

I was under the impression that the geography type only uses the lat,long based coordinates EPSG:4326. And I didn't remember having to specify a CRS for a geography column. However, from this ...
1
vote
2answers
132 views

Does transforming postGIS geographic data to EPSG:4326 , makes them geographic?

I am reading this about "Clustering on Indices" and in 25.2 says that The geohash algorithm only works on data in geographic (longitude/latitude) coordinates, so we need to transform the ...
2
votes
1answer
882 views

Add Geography Column to an existing table

I Have an existing table GPSPosition which has a coma seperated LatLong column. I have attempted to add a geography column using the query: alter table GPSPositions add geographyColumn as geography:...
2
votes
1answer
200 views

Fast(est) way to detect if point is in range of another point? (Geographic Coordinates)

I'm looking for a way to detect if 2 points are "near enough" each other for a match, and hopefully, if the range could be specified in metric system (each item may have different ranges, but there ...
1
vote
2answers
1k views

Transforming geographical points to geometry in PostGIS?

I have a PointField(geography=True) field in Django, which is translated into the following Postgres type: geography(Point,4326). I set the geography field to True because I thought it made sense for ...
7
votes
1answer
1k views

Export geography field from SQL for use in GIS

I currently have a table in SQL server management studio (2012) with a geography column. It definitely has valid spatial data, as I can view it in SSMS: What I want is to export the data as a ...
1
vote
2answers
3k views

Get latitude and longitude of a geography column

When doing the query in postgres to one that has a column whose data type is geography(MultiLineString, 4326) throws me the following result: select geom from base.osm_roads_free_1 limit 100; "...
1
vote
1answer
177 views

Strange result with ST_Distance, geography type and equator

I am getting strange results with distance queries in PostGIS using geography types and ST_Distance. According to the docs, ST_Distance should return the distance in metres between two geography ...
2
votes
1answer
364 views

What is ST_Geometry, ST_Curve and ST_Surface on PostGIS?

I dont't have any experience with geographics databases so I hope that you be patiente with me, so I opened this question (PostGis and datatypes WKT) in the past week about the datatypes in the ...
3
votes
1answer
201 views

Adding association for location with city or zip code when using PostGIS to add markers using geography?

On my front end, I am using google maps JS api. I am adding markers, the google maps event gives me the lat/lng for where I add the marker. I'm adding that marker into my postgres database: INSERT ...
52
votes
3answers
12k views

What is the purpose of PostGIS on PostgreSQL?

PostgreSQL already supports spatial data types, operators and indexing. What does PostGIS provide exactly that made it necessary to exist as an extension to PostgreSQL? Why don't we all just use ...
1
vote
0answers
525 views

How to implement Geography or geometry with spatial index implementation to find entities in the bounding box?

I have entities saved in SQL table with Lat and long values. I added another column to store Geometry values. Code for updating Geometry column UPDATE [dbo].[table] SET [GeoLocation] = geography::...
3
votes
2answers
9k views

Inserting lat/long data into geography column of SQL Server 2012?

is it possible to insert lat/long data into geography column just by typing the coordinates lat/long as a double or string: INSERT INTO LOT_EXPLOITATION_LOT VALUES (3621,'oui','Forêt Boréale',560000,'...
2
votes
1answer
184 views

How to set my ESPG to geography POINT in PostGIS?

I'm trying to create a table into my PostGIS 2.3 CREATE TABLE destinations ( id serial PRIMARY KEY, sector integer REFERENCES sectors(id)...
1
vote
1answer
73 views

Why I obtain different values calculating distance between two point in the space using this “Great-circle distance” formula and Google Earth tool?

I am not so into database and GIS and I have the following doubt about this function used on a MySql database to calculate the distance between 2 points. I am started from this tutorial where there ...
0
votes
1answer
484 views

Choosing target CRS value when doing geographic calculation?

In postgis, I use geography type, it support many geographic calculation, like st_dwithin(geography1, geography2, distance). What I need to do is just giving some points coordinates (lng, lat pair), ...
1
vote
0answers
145 views

Finding points around closest point of linestring ordered by distance using PostGIS?

I am looking for a way to improve my solution of the following problem in PostgreSQL (using PostGIS). Given a point A, a Linestring B and a series of (yellow) points spread all over the area in which ...
2
votes
2answers
699 views

How to pass parameters to PostGIS queries containing geography type in Python using psycopg2

I have the following example (adapted from the PostGIS manual (version 2.2): CREATE TABLE global_points ( id SERIAL PRIMARY KEY, name VARCHAR(64), location GEOGRAPHY(POINT,4326) ); ...
2
votes
1answer
902 views

Geography for Sql Server STIsValid() getting error

I am getting the following error Could not find method 'STIsValid' for 'Microsoft.SqlServer.Types.SqlGeography' in assembly 'Microsoft.SqlServer.Types' on the following query. select ogr_geog from ...
3
votes
2answers
3k views

ERROR: Only lon/lat coordinate systems are supported in geography

I'm trying to find out all the circles stored in the database(The circles are present all over the world) that intersect or overlap a given circle. I've stored the circles like this: CREATE TABLE ...
0
votes
1answer
99 views

Get value from list class (vector) in R [closed]

I have a simple question about corce(?) list class data into vector. I extract a tif file from polygon to achieve a list. Maybe the class of list is leaded by extract function. I check the list length ...
2
votes
0answers
343 views

How to properly deal with rectangles being curved on geographies?

I'm using Microsoft SQL Server to store simple data for administrative boundaries of the world (lots of polygons). I store this in a geography data type column. Afterwards I query these polygons by a ...
4
votes
1answer
768 views

How can I convert PostGIS geography to geometry and split polygons that cross the antimeridian

I have a PostGIS 2.2 table that stores polygons as geography type. The table contains several polygons that cross the antimeridian. I would like to split these polygons at the antimeridian and ...
6
votes
1answer
287 views

Preventing invalid values in PostGIS geography

If I use pgAdmin to insert a point with an invalid latitude, say 91°, I receive the following notice before the query completes successfully: NOTICE: Coordinate values were coerced into range [-...
3
votes
3answers
1k views

Why is geography faster than geometry for distance calculations?

Intuitively, I thought geometry would be faster than geography distance calculations, but this says otherwise: https://stackoverflow.com/questions/3547699/need-performance-on-postgis-with-geodjango#...
1
vote
1answer
333 views

Bounding rectangle of a geography

How to get a bounding box (in the form of a Polygon, or anything else where it's easy to extract the corner coordinates from) of a given Geography item? Something that would look like: SELECT ...
0
votes
1answer
392 views

Cleaning up inexact polygon unions

I have geography data stored in SQL Server and I am trying to merge polygons from two data sets together. The problem is that they do not line up exactly, so unioning them results in narrow gaps ...
1
vote
0answers
63 views

What is the file format

I have been sent a text-file (see below) with '.txt' extension. I would like to process it in ArcGIS or any other GIS-tool. Unfortunately I do not know how to automatically load the file as ArcGIS ...
2
votes
1answer
147 views

Bounding box along parallels and meridians

I have a PostGIS table with a column location geography(Point,4326). To select data from a specific region I use location && ST_MakeEnvelope(65,-77,120,-75). This may work well for most ...
1
vote
1answer
1k views

Postgis How to populate column with geography data from geometric data?

I stored my point date in geometry format with SRID 4326 supposed EWKB (data looks like this "0101000020E610000071F1A611E9392640AECD10D8E68C4A40") = way geometry(Point,4326) I want to have the ...
1
vote
0answers
322 views

Difference between adding spatial layer from MSSQL through “browser” and “add MSSQL table”

So I am trying to pinpoint the difference of adding layers from MSSQL Database that contains spatial layers like geography and geometry. I have noticed that when adding from the browser it retains it ...