{"id":13425132,"url":"https://github.com/jericks/geoc","last_synced_at":"2025-12-17T05:02:36.178Z","repository":{"id":21552563,"uuid":"24872232","full_name":"jericks/geoc","owner":"jericks","description":"A geospatial command line application.","archived":false,"fork":false,"pushed_at":"2023-11-05T22:02:00.000Z","size":79285,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T19:36:58.430Z","etag":null,"topics":["cli","geospatial","groovy"],"latest_commit_sha":null,"homepage":"http://jericks.github.io/geoc/index.html","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jericks.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-07T01:19:10.000Z","updated_at":"2022-10-31T23:44:10.000Z","dependencies_parsed_at":"2023-02-18T01:45:53.445Z","dependency_job_id":"f017f867-e7a1-4b3e-a1fd-862c8304fd26","html_url":"https://github.com/jericks/geoc","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/jericks/geoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jericks%2Fgeoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jericks%2Fgeoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jericks%2Fgeoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jericks%2Fgeoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jericks","download_url":"https://codeload.github.com/jericks/geoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jericks%2Fgeoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27777506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","geospatial","groovy"],"created_at":"2024-07-31T00:01:05.678Z","updated_at":"2025-12-17T05:02:36.159Z","avatar_url":"https://github.com/jericks.png","language":"Groovy","funding_links":[],"categories":["Groovy"],"sub_categories":[],"readme":".. image:: https://github.com/jericks/geoc/workflows/Maven%20Build/badge.svg\n    :target: https://github.com/jericks/geoc/actions\n\ngeoc\n====\ngeoc is a geospatial command line application that follows the unix philosophy.  Each command does one thing well (buffer a layer, crop a raster) by reading a vector layer as a CSV text stream or a raster layer as an ASCII grid, processing the layer or raster, and then writing out the vector layer as a CSV or a raster layer as an ASCII grid.  Individual commands can be chained together with unix pipes. \n\ngeoc is very much under development (command names may change).  Originally is was developed as a complement to `geometry commands \u003chttp://jericks.github.io/geometrycommands/index.html\u003e`_ and to stress test `GeoScript Groovy \u003chttp://geoscript.org/\u003e`_. The commands have not been optimized for large datasets.\n\ngeoc is built on the shoulders of giants: `GeoTools \u003chttp://geotools.org\u003e`_ and the `Java Topology Suite \u003chttp://tsusiatsoftware.net/jts/main.html\u003e`_.  geoc just provides a command line application that wraps the herculean effort that the developers of these two libraries have undertaken.\n\nKey features\n------------\n1. Git style commands.  One command (geoc) and many subcommands (which can be more than one word).\n2. By default geoc reads and writes vector layers as CSV and raster layers as ASCII grids.\n3. But geoc can read and write to any supported `GeoTools \u003chttp://geotools.org\u003e`_ DataStore (Shapefiles, PostGIS, H2) or CoverageStore (GeoTIFF, WorldImage, GTOPO).\n4. Commands are looked up using Java's Service Provider Interface (SPI) so the framework is extensible.\n5. Where appropriate, values are expressions (literals, properties, or CQL with functions)\n6. Uses `GeoScript Groovy \u003chttp://geoscript.net/\u003e`_ for extremely terse code.\n\nExamples\n--------\n\nList commands::\n\n    \u003e\u003e\u003e geoc list\n\nCount features in a CSV layer::\n\n    \u003e\u003e\u003e cat states.csv | geoc vector count\n\nBuffer feature from a shapefile::\n\n    \u003e\u003e\u003e geoc vector buffer -i earthquakes.shp -o earthquake_buffers.shp\n\nGet the envelope of a layer and then calculate the buffer::\n\n    \u003e\u003e\u003e cat states.csv | geoc vector envelope | geoc vector buffer -d 0.1   \n\nCrop a raster::\n\n    \u003e\u003e\u003e geoc raster crop -i raster.tif -b \"-120,-40,120,40\" -o raster_croped.tif\n\nHere is a longer example that create 100 random points in a GeoPackage database, get's metadata of that layer, and then finally converts the layer to CSV:::\n\n    \u003e\u003e\u003e geoc vector randompoints -g \"0 0 10 10\" -n 100 -o test.gpkg -r points100\n\n    \u003e\u003e\u003e geoc vector info -i test.gpkg -l points100\n\n    \u003e\u003e\u003e geoc vector to -i test.gpkg -f csv\n\nData Sources\n------------\nBy default, vector commands read and write CSV using WKT for geometry fields and raster commands read and write ASCII grids.\nBut, geoc can read and write any supported GeoTools DataStore or CoverageStore by using Connection Strings. GeoTools uses\nconnection maps to connect to DataStore's.  geoc connection strings are these connection maps where the key/value pairs are\nseparated by an '=' sign and multiple key/value pairs are separated by a white space.  Values can be single quoted.\n\nVector\n------\n**PostGIS**\n\n    dbtype=postgis database=postgres host=localhost port=5432 user=postgres passwd=postgres\n\n**MySQL**\n\n    dbtype=mysql database=layers host=localhost port=5432 user=me passwd=s$cr$t\n\n**H2**\n\n    test.db\n\n    dbtype=h2 database=test.db\n\n    dbtype=h2 host=localhost port=5432 schema=public user=me password=s$cr$t\n\n    dbtype=h2 jndiReferenceName=layers schema=public\n\n**Shapefile**\n\n    url=data/states.shp\n\n    data/states.shp\n\n**Memory**\n\n    memory\n\n**Properties**\n\n    data/states.properties\n\n    directory=data/properties\n\n**GeoPackage**\n\n    layers.gpkg\n\n    database=layers.gpkg dbtype=geopkg user=me passwd=s$cr$t\n\n**Geobuf**\n\n    layer.pbf\n\n    file=layers precision=6 dimension=2\n\n**Spatialite**\n\n    layers.sqlite\n\n    dbtype=spatialite database=layers.sqlite\n\n**OGR**\n\n    DatasourceName=states.shp DriverName='ESRI Shapefile' namespace=shp\n\n**WFS**\n\n    http://geoserver.org/wfs?request=getcapabilities\n\nRaster\n------\n\nRaster sources are currently all file based.\n\n    data/earth.tif\n\n    world.png\n\nTile\n----\n\n**pyramid**\n\n    Several tile layers can take a pyramid attribute.  You can use one of several well known pyramid names:\n\n    * globalmercator\n    * mercator\n    * globalmercatorbottomleft\n    * globalgeodetic\n    * geodetic\n\n    or use a file that contains pyramid metadata in csv, xml, or json format.\n\n\n**mbtiles**\n\n    type=mbtiles file=states.mbtiles\n\n    type=mbtiles file=states.mbtiles name=states description='The united states'\n\n    states.mbtiles\n\n\n**geopackage**\n\n    type=geopackage file=states.gpkg name=states pyramid=globalmercator\n\n    states.gpkg\n\n**tms**\n\n    type=tms file=/Users/you/tms format=jpeg\n\n    type=tms file=/Users/you/tms format=png name=tms pyramid=geodetic\n\n**osm**\n\n    type=osm url=http://a.tile.openstreetmap.org\n\n    type=osm urls=http://a.tile.openstreetmap.org,http://b.tile.openstreetmap.org\n\n**utfgrid**\n\n    type=utfgrid file=/Users/me/tiles/states\n\n**vectortiles**\n\n    type=vectortiles name=states file=/Users/me/tiles/states format=mvt pyramid=GlobalMercator\n\n    type=vectortiles name=states url=http://vectortiles.org format=pbf pyramid=GlobalGeodetic\n\nMap Layer\n---------\n\nMap layer strings contain a layertype, layername, layerprojection, and style properties.\n\n**layertype**\n\n    * layer\n    * raster\n    * tile\n\nFor layer layertype, you can use the same key value pairs used to specify a Workspace.\n\nFor raster layertype, you specify a source=file key value pair.\n\nFor tile layertype, you use the same key value pairs used to specify a tile layer.\n\n**layername**\n\n    The name of the layer\n\n**style**\n\n    A SLD or CSS File\n\n**Examples**\n\n    layertype=layer dbtype=geopkg database=/Users/user/Desktop/countries.gpkg layername=countries style=/Users/user/Desktop/countries.sld\n\n    layertype=layer file=/Users/user/Desktop/geoc/polygons.csv layername=polygons style=/Users/user/Desktop/geoc/polygons.sld\n\n    layertype=layer file=/Users/user/Desktop/geoc/points.properties style=/Users/user/Desktop/geoc/points.sld\n\n    layertype=layer file=/Users/user/Projects/geoc/src/test/resources/polygons.shp\n\n    layertype=layer directory=/Users/user/Projects/geoc/src/test/resources/points.properties layername=points\n\n    layertype=raster source=rasters/earth.tif\n\n    layertype=tile file=world.mbtiles\n\n    layertype=tile type=geopackage file=states.gpkg\n\nInstallation\n------------\nJust download the latest `release \u003chttps://github.com/jericks/geoc/releases\u003e`_ and put the geoc/bin directory on your path. geoc also requires Java 8.\n\nIf you want to use the OGR Workspace, you need to install the GDAL/OGR native library compiled with JNI support and then set the GEOC_GDAL_HOME variable.\n\nGetting Help\n------------\nEach command contains a --help option::\n\n    \u003e\u003e\u003e geoc vector buffer --help\n    geoc vector buffer: Buffer the features of the input Layer and save them to the output Layer\n    --help                      : Print the help message\n    -c (--capstyle) VAL         : The cap style\n    -d (--distance) VAL         : The buffer distance\n    -i (--input-workspace) VAL  : The input workspace\n    -l (--input-layer) VAL      : The input layer\n    -o (--output-workspace) VAL : The output workspace\n    -q (--quadrantsegments) N   : The number of quadrant segments\n    -r (--output-layer) VAL     : The output layer\n    -s (--singlesided)          : Whether buffer should be single sided or not\n\nThere is also a man page for each subcommand::\n\n    \u003e\u003e\u003e man geoc-vector-buffer\n    geoc-vector-buffer(1)                                    geoc-vector-buffer(1)\n\n    NAME\n           geoc vector buffer\n\n    DESCRIPTION\n           Buffer  the  features  of  the  input Layer and save them to the output\n           Layer\n\n    USAGE\n           geoc vector randompoints -n 10 -g \"1,1,10,10\" | geoc vector  buffer  -d\n           10\n\n    OPTIONS\n           -d --distance: The buffer distance\n\n           -q --quadrantsegments: The number of quadrant segments\n\n           -s --singlesided: Whether buffer should be single sided or not\n\n           -c --capstyle: The cap style\n\n           -o --output-workspace: The output workspace\n\nFinally, there is a bash completion script which makes using geoc with bash much easier.\n\nInstall it is your .bash_profile::\n    \n    source /Users/You/geoc/shell/geoc_bash_comp\n\nBuild\n-----\nBuilding geoc is very easy but you will need Java 8 and Maven 3.\n\nCheck it out::\n\n    git checkout https://github.com/jericks/geoc.git\n\nBuild it::\n\n    cd geoc\n    mvn clean install\n\nLicense\n-------\ngeoc is open source and licensed under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjericks%2Fgeoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjericks%2Fgeoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjericks%2Fgeoc/lists"}