Select to view content in your preferred language

Learning Python and SQL for GIS analysis

607
8
02-22-2025 08:56 AM
Sana_jamil1
Occasional Contributor

Hello!

I am a beginner in learning python. I have learnt the syntax of python but now I am confused what should I learn further to implement python in GIS as I am not expert in python. I also know my sql and same goes for it.

Can somebody guide me and tell me the road map for GIS Analyst.

Thank you!

8 Replies
HaydenWelch
MVP Regular Contributor

I really depends on what your application is, you can use Python scripting at almost every level of GIS.

If you're managing a lot of web services, you can look into the arcgis API for Python to help you automate and manage those servers.

If you want to pull data from existing GIS services, you can use a package like numpy or pandas/geopandas to do all sorts of data analysis.

If you're used to a chain of Geo processing tools, you can translate that workflow into a Python script and parameterize it to make it a single tool.

 

In my work, I use Python to do a lot of auto-drawing and design validation by pulling feature geometry from a database and hard coding rules that they need to abide by.

Sana_jamil1
Occasional Contributor

Thanks for your response!

 

HaydenWelch
MVP Regular Contributor

If you want some examples of how others use Python, check out the Developers > Python board!

 

There's a ton of good blog posts and code examples there. @DanPatterson and I are also trying to get the Python Snippets group back up and running and will be posting examples the as well

0 Kudos
BobBooth1
Esri Regular Contributor

If you're interested in using Python in ArcGIS Pro, check out this series of tutorials:

https://learn.arcgis.com/en/paths/learn-python-in-arcgis-pro/

You'll learn how to automate processes and build your own analysis tools.

These, and other tutorials using Python are available here:

https://learn.arcgis.com/en/gallery/#?q=python

AlfredBaldenweck
MVP Regular Contributor

Best way to get good at Python in GIS is to have a real-world use case for it. The tutorials are good, but they tend to spoonfeed you every answer and frequently aren't super relevant to your day-to-day work.

General rule of thumb is: If it's going to take you 3 hours to do it manually and it'd take about 3 hours to learn how to code it, learn to code it so that next time it only takes a few minutes.

HaydenWelch
MVP Regular Contributor

I'm up to roughly 10,000 hours of work saved using scripts. Tend to avoid scripting until I know the amount of time it will save, so it's easy to see exactly how much time the scripts have saved.

 

Only exception is when I know it's going to take a while to do by hand and there's a deadline. Script from scratch on those.

0 Kudos
Bud
by
Esteemed Contributor

Regarding SQL, what kind of geodatabase are you using? Oracle? SQL Server? File geodatabase?

ArcGIS Enterprise Questions - SQL Data Analysis - Books & Resources

@JoshuaBixby might find this interesting.

0 Kudos
Bud
by
Esteemed Contributor

You could consider asking similar SQL questions on the Data Management esri community.

Regarding enterprise geodatabases and mobile geodatabases (not file geodatabases): 

Many years ago, I remember @VinceAngelo saying something to the effect of, "If you're going to write SQL queries for ArcGIS, then you absolutely need a SQL client like Toad, SQL Developer (Oracle), or something similar. Not having SQL client software would be a severe limitation."

Like Vince, I think it's important you get yourself a SQL Client. If your I.T. department won't let you, consider downloading a portable version of a SQL client. I think Beekeeper Studio has a portable version. Maybe DBeaver does too. Portable software doesn't require Windows admin rights, so it's a way for you to install software without involving your I.T. department.

I'll say it one more time for emphasis - we definitely need a SQL Client when writing SQL queries for ArcGIS Pro, such as writing full-blown queries in query layers or database views. I have carved a SQL-centric GIS data anlysis career out of being the only person in the office who understands how tricky SQL can be. "SQL (and Python) are easy to pick up, but difficult to master" (source: SQL for Data Analysis by Cathy Tanimura). Nulls are an example of something that's surprisingly tricky/difficult to master. Tips about nulls in Oracle SQL

I imagine the same applies to Python - get yourself a Python editor like PyScripter or similar?

0 Kudos