'How to save an ArcGIS query result as a geoJSON file with linux wget command?

I'm having some issues saving the results of a query from an ArcGIS service in geoJSON format using wget. I can get the desired result if I use the query functionality from the ArcGIS service, but when I use wget to perform the operation, what I get is an html document saved in a geoJSON file. This is the wget command I run:

wget -O query_accidents.geojson https://sig.simur.gov.co/arcgis/rest/services/Accidentalidad/WSAcidentalidad_Publico/FeatureServer/0/query?where=ANO_OCURRENCIA_ACC+%3E%3D+2015&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&distance=&units=esriSRUnit_Foot&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=&returnTrueCurves=false&returnExceededLimitFeatures=false&quantizationParameters=&returnCentroid=false&timeReferenceUnknownClient=false&sqlFormat=none&resultType=&featureEncoding=esriDefault&datumTransformation=&f=geojson

The address above is generated by the ArcGIS service for a query where I simply filter using the the Where field (Where: column >= value), select all columns (Out Fields: *), return the Geometry (Return Geometry: True) and choose geoJSON as the format (Format: GeoJSON). I do nothing with the rest of the fields from the query functionality.

Not sure if relevant, but I'm using an Ubuntu terminal environment in WSL.

Any help is appreciated! Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source