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
23 views

Using ST_Area(geography) with ogrinfo in command line?

I want to to calculate the ellipsoidal/spheroidal area of each grid cell of a vector grid using ogrinfo. When using ST_Area(geometry) I get the 2D planimetric area (which seems to be constant for a ...
1
vote
1answer
103 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’. ...
1
vote
0answers
176 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
156 views

Convert datatype in Google Earth Engine from double to integer

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
90 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
60 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
156 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
0answers
232 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
576 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
368 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
624 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
276 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
43 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
542 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
94 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
638 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
137 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
812 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
2k 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
149 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
299 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
170 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 ...
49
votes
3answers
10k 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
464 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
6k 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
126 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
70 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
281 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
134 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
459 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
704 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 ...
2
votes
2answers
2k 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
62 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
290 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 ...
3
votes
1answer
583 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
247 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
258 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
315 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
124 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
314 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 ...
1
vote
1answer
1k views

SQL Server geometry vs. geography in Esri map service

We have a SQL Server 2008R2 database where point coordinates are stored as decimal degrees. I want to create an Esri map service which shows those points. As the point data is dynamic I decided to ...
3
votes
1answer
697 views

SQL Server Geography Query works but Geometry Query Does Not - Different Tables, Similar Schemas

I am trying to get a Geometry query to work. A similar Geography query works fine but I must work with a table that uses a Geometry type. Although the Geography version returns lots of records as ...
1
vote
1answer
626 views

Changing ArcSDE binary formatted data to MSSQL Geography or Geometry data types? [closed]

We are currently using ArcSDE 9.3 to store our Geodata. In a project which is currently being implemented, the software being used can access most data formats including the ArcSDE binary format and/...
2
votes
2answers
954 views

SQL Error: Latitude values must be between -90 and 90 degrees

I'm more of an ArcGIS user than a SQL Server user but I have polygon data in a 'geography' type in SQL 2008 R2. For a couple of these poly layers, I get this persistent drawing error in ArcMap: ...
46
votes
1answer
36k views

Choosing SRID and what is its meaning? [closed]

I'm new to GIS, in PostGIS, and I'm struggling with the SRID concept. How do you choose a SRID for a database column? This is making me crazy. Why do I need to choose a SRID? What's its meaning? ...
15
votes
3answers
7k views

Using geometry rather than geography data types in SQL Server Spatial?

Historically I've mainly worked with simple latitude and longitude coordinates in a SQL Server. I stored them as a geography datatype in SQL Server, and rendered them on a variety of displays (...