Back to Blog

What is PostGIS? Complete Guide to Spatial Databases

Atlas TeamAtlas Team
Share this page
What is PostGIS? Complete Guide to Spatial Databases

The most effective spatial data infrastructure combines the power of relational databases with native geographic capabilities. PostGIS transforms PostgreSQL—one of the world's most trusted databases—into a full-featured spatial database capable of storing, querying, and analyzing geographic data at enterprise scale.

If your spatial workflows rely only on file-based formats like Shapefiles or GeoJSON, you're missing the database-level power that enables complex spatial queries, multi-user editing, and seamless integration with existing data infrastructure. That's why GIS professionals ask: can we store and query our spatial data in a proper database while still visualizing it in modern mapping tools?

With Atlas, connecting to PostGIS databases is straightforward. Query spatial tables directly, visualize PostGIS geometries on interactive maps, and combine database power with browser-based collaboration—no desktop GIS required. Here's everything you need to know about PostGIS and how to connect it to Atlas.


What is PostGIS?

PostGIS is a spatial database extension for PostgreSQL that adds support for geographic objects, enabling location queries to run directly in SQL. It transforms PostgreSQL from a standard relational database into a powerful spatial database that can store, index, and query geographic data efficiently.

PostGIS has become the de facto standard for open-source spatial databases, powering everything from small web applications to large government geoportals and enterprise GIS infrastructure.


How PostGIS Works

PostGIS extends PostgreSQL by adding:

Geometry Data Types

PostGIS introduces new column types for storing geographic features:

  • Point: Single locations (coordinates)
  • LineString: Connected sequences of points (roads, rivers, paths)
  • Polygon: Enclosed areas (parcels, boundaries, regions)
  • MultiPoint, MultiLineString, MultiPolygon: Collections of geometries
  • GeometryCollection: Mixed geometry types

Spatial Functions

PostGIS includes hundreds of functions for spatial operations:

Function TypeExamplesUse Case
RelationshipsST_Contains, ST_Intersects, ST_WithinFind features inside or overlapping other features
MeasurementsST_Distance, ST_Area, ST_LengthCalculate distances, areas, and lengths
TransformationsST_Buffer, ST_Union, ST_IntersectionCreate buffers, merge, or clip geometries
AccessorsST_X, ST_Y, ST_AsGeoJSON, ST_AsTextExtract coordinates or convert formats
ConstructorsST_MakePoint, ST_GeomFromText, ST_GeomFromGeoJSONCreate geometries from coordinates or text

Spatial Indexing

PostGIS uses GiST (Generalized Search Tree) indexes to make spatial queries fast. Without indexing, finding all points within a polygon would require checking every single feature. With spatial indexing, PostGIS can quickly narrow down candidates before performing precise geometric calculations.


PostGIS vs. File-Based Formats

Understanding when to use PostGIS versus file-based formats helps choose the right approach for your project:

AspectPostGISShapefile/GeoJSON
Multi-user accessYes, with concurrent editing and transactionsNo, file locking issues
Query capabilityFull SQL with spatial functionsLimited, requires loading entire file
Data integrityACID transactions, constraints, validationNone built-in
ScalabilityMillions of features, efficient indexingPerformance degrades with size
IntegrationDirect connection from applicationsFile import/export required
VersioningBuilt-in PostgreSQL featuresExternal version control needed

PostGIS excels when:

  • Multiple users need to edit the same dataset
  • Complex spatial queries are required
  • Data integrity and validation matter
  • Integration with existing database infrastructure is needed
  • Datasets contain millions of features

File-based formats work well for:

  • Simple data sharing and exchange
  • Small to medium datasets
  • Offline work or field collection
  • Situations where database setup isn't feasible

Connect PostGIS to Atlas

Atlas connects directly to PostGIS databases, enabling visualization and analysis of spatial data stored in PostgreSQL without exporting to files.

Step 1: Prepare Your PostGIS Database

Before connecting, ensure your PostgreSQL database has PostGIS installed:

  • Verify PostGIS installation by running SELECT PostGIS_Version(); in your database
  • Check geometry columns with SELECT * FROM geometry_columns; to see available spatial tables
  • Ensure network access by confirming your database accepts connections from external IP addresses
  • Note your credentials including host, port, database name, username, and password

Once your database is accessible, Atlas can connect and query your spatial tables directly.

Step 2: Create the Connection in Atlas

Atlas makes connecting to PostgreSQL databases straightforward:

  1. Open Add Data by clicking the Add Data button in the Layers panel
  2. Select Connections tab to access external data source options
  3. Choose PostgreSQL from the available connection types
  4. Enter connection details:
    • Connection Name: A friendly identifier for this connection
    • Host: Your database hostname or IP address
    • Port: PostgreSQL port (default: 5432)
    • Database: The database name containing your spatial data
    • Username and Password: Your database credentials
  5. Click Create Connection to establish the link

Step 3: Configure SSL (If Required)

For secure connections to cloud databases or production systems:

  • Enable SSL/TLS for encrypted communication
  • Upload certificates if your database requires client certificate authentication:
    • Client Certificate (PEM or CRT format)
    • Private Key (PEM or KEY format)
    • CA Certificate for server verification

Step 4: Import Spatial Tables

After connecting, browse your database contents:

  • View available tables and see which contain geometry columns
  • Select tables to import by checking the ones you want to visualize
  • Click Add to Project to import the selected tables as map layers
  • Tables with PostGIS geometries automatically import as vector layers with all attributes preserved

Step 5: Work with Your Data

Once imported, PostGIS layers work like any other Atlas layer:

  • Style features using attribute-based symbology
  • Query and filter to focus on specific subsets
  • Run spatial analysis using Atlas's built-in tools
  • Share and collaborate with your team in real-time

Also read: Top 10 GIS Software in 2026

Step 6: Firewall Configuration

If your database is behind a firewall, whitelist these Atlas IP addresses to allow connections:

16.16.129.130
51.20.23.178
13.50.71.210
51.21.188.73

This ensures Atlas can reach your PostGIS database for data import and synchronization.


Common PostGIS Use Cases

PostGIS powers spatial data infrastructure across industries:

  • Urban planners storing zoning boundaries, parcel data, and infrastructure networks in centralized databases that connect to multiple applications and visualization tools
  • Environmental agencies managing large-scale datasets of monitoring stations, watershed boundaries, and species observations with complex spatial queries
  • Logistics companies calculating routes, service areas, and optimizing delivery networks using spatial SQL queries against millions of addresses
  • Real estate platforms running proximity queries to find properties near amenities, within school districts, or inside specific market areas
  • Utility companies maintaining network infrastructure data with topological relationships and multi-user editing across field and office teams

PostGIS is essential for any organization where spatial data is a core business asset requiring database-level management, querying, and integration.


PostGIS Tips and Best Practices

  • Always use spatial indexes by creating GiST indexes on geometry columns with CREATE INDEX idx_name ON table USING GIST (geom);—queries can be 1000x faster with proper indexing
  • Store data in appropriate projections using a projected coordinate system for distance and area calculations, or WGS84 (EPSG:4326) for web mapping compatibility
  • Use geography type for global data when working with worldwide datasets where accurate distance calculations across the globe matter more than local precision
  • Validate geometries before importing with ST_IsValid() and fix issues with ST_MakeValid() to prevent errors in spatial operations
  • Leverage views for complex queries by creating database views that pre-filter or transform data, making it easier to connect from Atlas without writing complex queries each time

These practices ensure PostGIS databases remain performant and reliable as data volumes grow.


Spatial Database Power with Atlas

Managing spatial data in PostGIS provides enterprise-grade capabilities, but visualizing and sharing that data shouldn't require desktop GIS software or complex web development.

Transform Database Tables into Interactive Maps

Atlas connects directly to PostGIS, enabling:

  • Live database connections that reflect current data without export/import cycles
  • Visual exploration of spatial tables on interactive maps
  • Collaborative analysis where teams work together on database-connected layers

Also read: QGIS vs. ArcGIS: Complete Comparison for 2026

Build Workflows That Scale

Atlas lets you:

  • Connect multiple databases from different PostgreSQL instances in one project
  • Combine PostGIS data with other sources like spreadsheets, files, and APIs
  • Share database-connected maps with stakeholders who don't need database access

That means no more exporting Shapefiles for every visualization, and no more version conflicts from file-based sharing.

Map Smarter with Location Intelligence

PostGIS provides the foundation for serious spatial data management. Atlas makes that data accessible to everyone who needs it—from analysts running spatial queries to stakeholders viewing interactive dashboards. It's database-connected GIS—designed for teams that need both power and accessibility.


Get Started with PostGIS and Atlas

Spatial databases like PostGIS represent the professional approach to managing geographic data. The combination of SQL query power, spatial indexing, and enterprise database features makes PostGIS the choice for organizations serious about their spatial data infrastructure.

Atlas gives you the visualization and collaboration layer that makes PostGIS data accessible. Connect your databases, visualize your spatial tables, and share interactive maps—all from your browser.

Connect to PostGIS and transform your spatial database into interactive maps. Whether you're managing infrastructure networks, analyzing environmental data, or building location-aware applications, Atlas helps you move from 'data in the database' to 'insights in the hands of decision-makers' faster.

Ready to connect your PostGIS database? Sign up for Atlas or book a walkthrough to see how database connections work.