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

How to store GeoJSON data in Big Query to be able to seamlessly work with Big Query GIS functions

I have this polygon which I have imported as such bq load \ --source_format=NEWLINE_DELIMITED_JSON \ --json_extension=GEOJSON \ --autodetect \ dataset.GeoJson \ sites.json From this I get this ...
4
votes
1answer
65 views

ogr2ogr cannot import into table with two geography columns

I am using ogr2ogr to import geojson files into a PostGIS table. The table has two geography columns ("footprint" and "centroid"). The geojson files contain polygon features, and I ...
1
vote
1answer
26 views

Make geographic squares that follow parallels in SQL Server

I have a list of points (with latitude and longitude) in an SQL Server database, and for each of these points I have to generate a 50 x 50 degrees square (the point being the South West angle of the ...
0
votes
0answers
87 views

SQL Server error when creating Geography data from a Multipolygon Geometry

So, in SQL server, I have a table called Municipios, which contains a column with 2463 entries of geometry type, with their SRID set to 4326. I'm running the following Query to try to convert them to ...
1
vote
1answer
37 views

PostGIS-Geography doesn't show in QGIS after database restore

I recently restored a PostgreSQL database from a SQL dump. It worked well insofar as all my tables and data are restored. However, one of the original tables contained a PostGIS geography column ...
1
vote
1answer
60 views

Assurance that ST_Envelope works with geography as expected

Using PostGIS, I have a table of data with geographic points defined as last_known_coordinates GEOGRAPHY(POINT,4326). I want to find all of these within a geographic bounding box with given top left ...
4
votes
1answer
122 views

Inserting geography data types with GeoPandas

I would like to insert a geodataframe containing point geometries in SRID 4326 to an existing table in PostGIS+PostgreSQL. The issue is that I would like to retain the existing table structure, which ...
3
votes
0answers
89 views

BRIN Index on PostGIS Geography

I have about 1.5 billion points in a geography column which represent topography. I'll be retrieving all the points that are within a certain distance of a given long/lat. I was able to create a GIST ...
1
vote
0answers
26 views

SQLServer STArea issue with GEOMETRYCOLLECTION resulting in trillion's m2 area

I've come across a weird issue with SQL Server's handling of GEOMETRYCOLLECTION in a Geography data type resulting in an area (square meters) in the trillion's of square meters. (checked on 2014, ...
0
votes
0answers
38 views

PostGIS Geography Data Changed After pg_restore

Two PostGIS databases (PostGIS 3.0, PostgreSQL 13.1) were setup on two separate machines to be as close to each other as possible using a Docker image kartoza/postgis:13.1. A dump of the database was ...
3
votes
1answer
63 views

Geography in GeoPandas?

Is there a way to make GeoPandas work with geographies? If GeoPandas were used with pygeos, is there a way to force all calculations (ST_Distance, ST_Length, etc.) to be geodesic? How do I tell it ...
1
vote
1answer
115 views

How to get most accurate Point-Point distance queries in Europe with Spatialite

I have a GeoDjango app, currently on PostGIS, which I am converting to use Spatialite db instead. I have no specialised knowledge about GIS systems :( The locations table has a Geography column ...
7
votes
1answer
1k views

Is the Geometry(4326) an alias for Geography datatype?

The main reference about Geography datatype seems docs/using_postgis_dbmanagement: Prior to PostGIS 2.2, the geography type only supported WGS 84 long lat (SRID:4326). For PostGIS 2.2 and above, any ...
2
votes
1answer
40 views

Complexify geography polygons in PostGIS

Is it possible to modify polygons (essentially, make them more complex by inserting additional points) so that their naïve point-linking rendering would be a closer match to their respective geodesic ...
4
votes
1answer
70 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
594 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
61 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
244 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
66 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
289 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
598 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
631 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 ...
1
vote
1answer
3k 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
736 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
170 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 ...
1
vote
1answer
691 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
2k 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
569 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." ...
3
votes
1answer
4k 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 ...
3
votes
1answer
473 views

Using use_spheroid=false in ST_DWithin of PostGIS

I have created 2 geography columns and indexed them using GIST. I am looking to use ST_DWithin for a larger dataset and to make it faster trying to use the use_spheroid=false. SELECT pois.objectid, ...
2
votes
0answers
777 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 ...
1
vote
1answer
68 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
816 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
184 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
1k 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
419 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
2k 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 ...
8
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
194 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
441 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
267 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 ...
57
votes
3answers
13k 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
597 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
11k 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
286 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
76 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
861 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
197 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
1k 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) ); ...