TransWikia.com

Performing spatial queries with the SODA API in Python

Geographic Information Systems Asked on June 7, 2021

I am trying to fetch data from data.cityofnewyork.us with the Python client sodapy. It generally works as it should, but I just can’t figure out how to perform spatial queries. For example, I would like to get the simplified geometry data by leveraging simplify(), but it doesn’t return a geometry at all. How can I get this to work?

from sodapy import Socrata

identifier_build = 'qjdb-bxqz'
client_build = Socrata(domain, None)

results_build = client_build.get(identifier_build,limit=5, 
                                 select="CNSTRCT_YR,simplify(the_geom,0.01) AS the_geom", 
                                 where ="FEAT_CODE==2100")

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP