
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
carto-geocoding-sql
Advanced tools
Turns simple text locations into SQL queries to be run against CARTO geocoding API
Turns simple text locations into SQL queries ready to be run against CARTO geocoding API.
It'll *magically*™ decide which SQL function it should call depending on the content you provide.
var geocodeSQL = require('carto-geocoding-sql');
geocodeSQL('Stockholm');
// SELECT cdb_geocode_namedplace_point('Stockholm') the_geom;
// assumes a city by default
geocodeSQL('South Africa');
// SELECT ST_Centroid(cdb_geocode_admin0_polygon('South Africa')) the_geom;
// ... unless it's a country, in which case it will use its centroid
geocodeSQL('200.199.198.197');
SELECT cdb_geocode_ipaddress_point('200.199.198.197') the_geom;
// IP adresses !
geocodeSQL('Paris, USA');
// SELECT cdb_geocode_namedplace_point('Paris','USA') the_geom;
// two fragments separated by a comma: assume city, country
geocodeSQL('75013, France');
// SELECT cdb_geocode_postalcode_point('75013','France') the_geom;
// numbers in first fragment: assume postal code
geocodeSQL('201 Moore St, Brooklyn, USA');
geocodeSQL('201 Moore St, Brooklyn, NY, USA');
// SELECT cdb_geocode_street_point('201 Moore St','Brooklyn','','USA') the_geom;
// street level address with 3+ fragments, with or without state
Send multiple strings if you need several geocodings at once:
geocodeSQL('Utrecht', '81.204.10.10', 'Roelof Hartplein 2G, Amsterdam, Nederland');
//SELECT cdb_geocode_namedplace_point('Utrecht') the_geom UNION SELECT cdb_geocode_ipaddress_point('81.204.10.10') the_geom UNION SELECT cdb_geocode_street_point('Roelof Hartplein 2G','Amsterdam','','Nederland') the_geom;
Carto-geocoding-sql can be run on the command line with carto-geocode-sql:
➜ carto-geocode-sql 'Germany'
SELECT ST_Centroid(cdb_geocode_admin0_polygon('Germany')) the_geom;
➜ carto-geocode-sql 'Beijing'
SELECT cdb_geocode_namedplace_point('Beijing') the_geom;
Protip: use with the CARTO node client CLI
➜ cartodb -f geojson "`carto-geocode-sql '201 Moore St, Brooklyn, USA'`"
{"type": "FeatureCollection", "features": [{"type":"Feature","geometry":{"type":"Point","coordinates":[-73.93661,40.70442]},"properties":{}}]}
Runs on Node > 4.0 Should run on the browser, but it has not been tested and should be packaged with your method of choice.
FAQs
Turns simple text locations into SQL queries to be run against CARTO geocoding API
We found that carto-geocoding-sql demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.