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 Type | Examples | Use Case |
|---|---|---|
| Relationships | ST_Contains, ST_Intersects, ST_Within | Find features inside or overlapping other features |
| Measurements | ST_Distance, ST_Area, ST_Length | Calculate distances, areas, and lengths |
| Transformations | ST_Buffer, ST_Union, ST_Intersection | Create buffers, merge, or clip geometries |
| Accessors | ST_X, ST_Y, ST_AsGeoJSON, ST_AsText | Extract coordinates or convert formats |
| Constructors | ST_MakePoint, ST_GeomFromText, ST_GeomFromGeoJSON | Create 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:
| Aspect | PostGIS | Shapefile/GeoJSON |
|---|---|---|
| Multi-user access | Yes, with concurrent editing and transactions | No, file locking issues |
| Query capability | Full SQL with spatial functions | Limited, requires loading entire file |
| Data integrity | ACID transactions, constraints, validation | None built-in |
| Scalability | Millions of features, efficient indexing | Performance degrades with size |
| Integration | Direct connection from applications | File import/export required |
| Versioning | Built-in PostgreSQL features | External 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:
- Open Add Data by clicking the Add Data button in the Layers panel
- Select Connections tab to access external data source options
- Choose PostgreSQL from the available connection types
- 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
- 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 withST_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
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.

