History#
0.19.4 (2025-05-23)#
New Features#
Update the links for eHydro web services to the latest addresses.
0.19.3 (2025-03-07)#
Internal Changes#
Use
orjsoninstead ofujsondue to the package not being maintained anymore. The developer ofujsonraised conrcerns about security vulnerabilities and recommended usingorjsoninstead.
0.19.0 (2025-01-17)#
Internal Changes#
Update all dependencies on HyRiver libraries to the latest versions and modify the code to be compatible with the latest versions of the libraries.
0.18.0 (2024-10-05)#
New Features#
Update the links for NLDI and PyGeoAPI web services to the latest addresses.
Bug Fixes#
Fix a bug in
WFS.getfeature_bygeomwhere if the input geometry is in a geographic CRS, the function fails to transform it correctly to the web service’s CRS.
Breaking Changes#
Drop support for Python 3.8 since its end-of-life date is October 2024.
Remove all exceptions from the main module and raise them from the
exceptionsmodule. This is to declutter the public API and make it easier to maintain.
0.17.1 (2024-09-14)#
New Features#
Update the links for FEMA web services to the latest addresses.
When the CRS of a WMS cannot be parsed throw a more informative error regarding the service being down (GH 122).
Internal Changes#
Drop support for Python 3.8 since its end-of-life date is October 2024.
0.17.0 (2024-05-16)#
Internal Changes#
Make
streaming_downloadmore robust when encoutring request issues by returningNonefor those links that have failed to be processed, instead of throwing exceptions. So, for example, if only one link fails, the function will return a list of paths withNonefor the failed link.In all requests by geometries, set the geometry precision to 6 decimal points to avoid issues with large decimal points.
Add the
exceptionsmodule to the high-level API to declutter the main module. In the future, all exceptions will be raised from this module and not from the main module. For now, the exceptions are raised from both modules for backward compatibility.
0.16.2 (2024-04-24)#
Internal Changes#
Remove the deprecated AirMap URL.
0.16.1 (2024-01-15)#
Bug Fixes#
pyprojuses its own env variables for SSL certification. This release fixes the issue withpyprojnot being able to download the grid database when using DOI SSL certification file. This release usespyproj.network.set_ca_bundle_pathfor setting the SSL certification file given by the user viaHYRIVER_SSL_CERTenv variable.Fix an issue in
WFS.getfeature_byidwhere themax_nrecordsargument was not being used correctly, thus resulting in large requests to fail.
Internal Changes#
For
ServiceURLclass, usedataclassinstead for better performance and consistency.
0.16.0 (2024-01-03)#
New Features#
Add a new arg to
WMS.getmap_byboxcalledtiff_dirfor storing the responses from a WMS request as a GeoTIFF file on disk instead of keeping all responses in memory. When this arg is given the function return a list of paths to these files. This is useful for large requests where the response is too large to be kept in memory. You can create a VRT file from these files usingpygeoutils.gtiff2vrtfunction.
0.15.2 (2023-09-22)#
New Features#
Added RESTfulURLs for FEMA’s National Flood Hazard Layer (NFHL) service. Contributed by Fernando Aristizabal. (PR 62)
Now,
RetrySessioncan be used as a context manager. This is useful for closing the session after using it. For example:
from pygeoogc import RetrySession
with RetrySession() as session:
r = session.get("https://httpbin.org/get").json()
Internal Changes#
Improve the example in the docstring of
traverse_jsonfunction.Improve exception handling in the
ArcGISRESTfulclass and return a more informative error message.
0.15.1 (2023-08-02)#
From release 0.15 onward, all minor versions of HyRiver packages
will be pinned. This ensures that previous minor versions of HyRiver
packages cannot be installed with later minor releases. For example,
if you have pygeoogc==0.14.x installed, you cannot install
pygeoogc==0.15.x series. This is to ensure that the API is
consistent across all minor versions.
New Features#
Add the STN Flood Event Data URL to the list of RESTfuls. Contributed by Fernando Aristizabal. (PR 59)
Add the link for the eHydro’s web service.
0.15.0 (2023-05-07)#
From release 0.15 onward, all minor versions of HyRiver packages
will be pinned. This ensures that previous minor versions of HyRiver
packages cannot be installed with later minor releases. For example,
if you have pygeoogc==0.14.x installed, you cannot install
pygeoogc==0.15.x series. This is to ensure that the API is
consistent across all minor versions.
New Features#
For now, retain compatibility with
shapely<2while supportingshapley>=2.
Bug Fixes#
Fix an issue in
WFSwhere thegetfeature_bygeommethod fails if the requested web service does not havegeometry_columnattribute in its schema. This release addresses this issue by trying to find the name from other attributes in the schema. If it fails to find, it raises aValueError.Catch an edge case in
match_crsfunction where the input is a list of coordinates of length 4.Give precedence to non-default arguments for caching related arguments instead of directly getting them from env variables. This is to avoid the case where the user sets the env variables but then passes different arguments to the function. In this case, the function should use the passed arguments instead of the env variables.
Internal Changes#
Remove
pyyamlas a dependency since it is not used anymore.
0.14.0 (2023-03-05)#
Breaking Changes#
Bump the minimum required version of
shapelyto 2.0, and use its new API.
Internal Changes#
Sync all minor versions of HyRiver packages to 0.14.0.
0.13.12 (2023-02-10)#
New Features#
Make
match_crsless strict in terms of the input geometry type beingtupleorlistby relying onshapelyandcontextlib.suppress. So, now users can pass any combination oflistortupleas coordinates or bounding box.More robust handling of inputs and outputs in
streaming_download. Now, only if input isstrthe function returns a singlePathobject. Previously if there was only one URL, whetherlistof length one orstr, the output was a singlePath, which could have had unintended consequences.
Bug Fixes#
In
WFSwhen some layers have missing schema info, the class failed to initialize. This release fixes this issue by ignoring layers with missing schema info and asks the user to pass a sort parameter instead of trying to automatically find a sort parameter. This fix also improves the performance of this function by making fewer web requests.
Internal Changes#
Fully migrate
setup.cfgandsetup.pytopyproject.toml.Convert relative imports to absolute with
absolufy-imports.Sync all patch versions of HyRiver packages to x.x.12.
0.13.10 (2023-01-08)#
Bug Fixes#
Internal Changes#
Use
pyrightfor type checking instead ofmypysince it is faster and more accurate. Also, fix all the type errors reported bypyright.Improve code quality by addressing issues raised by DeepSource.
0.13.9 (2022-12-15)#
Bug Fixes#
Add the missing annotation import to the
cache_keysto ensure Python 3.8 and 3.9 work with Python 3.10 style type hinting.
0.13.8 (2022-12-09)#
New Features#
Add a new property to
WFSclass calledschemathat contains information about column names and their types for all layers. It also the geometry type and its name for each layer.Automatically determine the geometry keyword that should be passed to
WFS.getfeature_bygeomusing the newschemaproperty ofWFS.Add support for disabling SSL verification to
RetrySessionviasslparameter.Add support for streaming responses to
RetrySessionviastreamparameter togetandpostmethods.Add support for closing the session to
RetrySessionviaclosemethod.Add support for passing
params,data, andjsontoRetrySessionviagetandpostmethods. Previously, keywordpayloadwas used forparamsingetanddatainpost. Now,paramsanddatacan also be passed as keyword arguments to these methods.Add a new function called
streaming_downloadfor downloading large files in parallel and in chunks.
Bug Fixes#
Fix an issue in
WFSclass where number of requested features exceeds the maximum number of features allowed by the server, but only a portion of the features are returned. This release addresses this issue by first getting only the number of features and then requesting the features in chunks of features IDs based on the maximum number of features allowed by the server.
Internal Changes#
Drop support for WFS version 1.0.0 since it does not support paging.
Modify the codebase based on Refurb suggestions.
Bug Fixes#
Fix the warning message in
ArcGISRESTFulwhere wrong number of missing feature IDs were being reported.
0.13.7 (2022-11-04)#
New Features#
Add a new method to
RetrySessionfor getting the request head calledRetrySession.head. This is useful for getting the headers of a request without having to make a full request which is useful for getting theContent-Lengthheader for example, i.e., download size.
Bug Fixes#
Fix an issue in the decompose function,
utils.bbox_decompose, where the generated bounding boxes might overlap in some cases. A new approach has been implemented based on finding the number of required bounding boxes from max allowable no. of pixels and total requested pixels without changing the input bounding box projection. This ensures that the decomposed bounding boxes are not overlapping soxarray.open_mfdatasetcan be used without any issues.
Internal Changes#
In the
utils.match_crsfunction, don’t perform any projection if the source target CRS are the same.Improve type hints for CRS-related arguments of all functions by including string, integer, and
pyproj.CRStypes.Add a new class method to
WMSBaseandWFSBaseclasses calledget_service_optionsfor retrieving the available layers, output formats, and CRSs for a given service. Here’s an example:Use
pyupgradepackage to update the type hinting annotations to Python 3.10 style.
from pygeoogc.core import WMSBase
url = "https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer"
wms = WMSBase(url, validation=False)
wms.get_service_options()
print(wms.available_layer)
0.13.6 (2022-08-30)#
Internal Changes#
Add the missing PyPi classifiers for the supported Python versions.
0.13.5 (2022-08-29)#
Breaking Changes#
Append “Error” to all exception classes for conforming to PEP-8 naming conventions.
Internal Changes#
Bump minimum version of
owslibto 0.27.2 since thepyprojincompatibility issue has been addressed in this issue.Bump minimum version of
requests-cacheto 0.9.6 since theattrsversion issue has been addressed.
0.13.3 (2022-07-31)#
New Features#
Add support for disabling persistent caching in
RetrySessionvia an argument and alsoHYRIVER_CACHE_DISABLEenvironmental variable.
0.13.2 (2022-06-14)#
Breaking Changes#
Set the minimum supported version of Python to 3.8 since many of the dependencies such as
xarray,pandas,rioxarrayhave dropped support for Python 3.7.Pin
owslibto version <0.26 since version 0.26 has pinnedpyprojto version <3.3 which is not compatible withrasterioon macOS.
Internal Changes#
Use micromamba for running tests and use nox for linting in CI.
0.13.1 (2022-06-11)#
New Features#
More robust handling of errors in
ArcGISRESTfulby catchingNoneresponses. Also, use thePOSTmethod forArcGISRESTful.bysqlsince the SQL Clause could be a long string.
0.13.0 (2022-04-03)#
Breaking Changes#
Remove caching-related arguments from all functions since now they can be set globally via three environmental variables:
HYRIVER_CACHE_NAME: Path to the caching SQLite database.HYRIVER_CACHE_EXPIRE: Expiration time for cached requests in seconds.HYRIVER_CACHE_DISABLE: Disable reading/writing from/to the cache file.
You can do this like so:
import os
os.environ["HYRIVER_CACHE_NAME"] = "path/to/file.sqlite"
os.environ["HYRIVER_CACHE_EXPIRE"] = "3600"
os.environ["HYRIVER_CACHE_DISABLE"] = "true"
Bug Fixes#
In
ArcGISRESTful.oids_byfieldconvert the inputidsto alistif a user passes a singleid.
Internal Changes#
Refactor
ServicURLto hard code the supported links instead of reading them from a file. Also, the class now is based onNamedTuplethat has a nicer__repr__.
0.12.2 (2022-01-15)#
New Features#
Make
validate_crspublic that can be accessed from theutilsmodule. This is useful for checking validity of user input CRS values and getting its string representation.Add
pygeoogc.utils.valid_wms_crsfunction for getting a list of valid CRS values from a WMS service.Add 3DEP’s index WFS service for querying availability of 3DEP data within a bounding box.
Internal Changes#
Add type checking with
typeguardand fixed typing issues raised bytypeguard.Refactor
show_versionsto ensure getting correct versions of all dependencies.
0.12.1 (2021-12-31)#
Internal Changes#
Use the three new
ar.retrieve_*functions instead of the oldar.retrievefunction to improve type hinting and to make the API more consistent.
0.12.0 (2021-12-27)#
New Features#
Add a new argument to
ArcGISRESTfulcalledverboseto turn on/off all info level logs.Add an option to
ArcGISRESTful.get_featurescalledget_geometryto turn on/off requesting the data with or without geometry.Now,
ArcGISRESTfulsaves the object IDs of the features that user requested but are not available in the database to./cache/failed_request_ids.txt.Add a new parameter to
ArcGISRESTfulcalleddisable_retrythat IfTruein case there are any failed queries, no retrying attempts is done and object IDs of the failed requests are saved to a text file which its path can be accessed viaArcGISRESTful.client.failed_path.Set response caching expiration time to never expire, for all base classes. A new argument has been added to all three base classes called
expire_afterthat can be used to set the expiration time.Add a new method to all three base classes called
clear_cachethat clears all cached responses for that specific client.
Breaking Changes#
All
oids_by*methods ofArcGISRESTfulclass now return a list of object IDs rather than settingself.featureids. This makes it possible to pass the outputs of theoids_by*functions directly to theget_featuresmethod.
Internal Changes#
Make
ArcGISRESTfulless cluttered by instantiatingArcGISRESTfulBasein theinitmethod ofArcGISRESTfulrather than inheriting from its base class.Explicitly set a minimum value of 1 for the maximum number of feature IDs per request in
ArcGISRESTful, i.e.,self.max_nrecords.Add all the missing types so
mypy --strictpasses.
0.11.7 (2021-11-09)#
Breaking Changes#
Remove the
onlyipv4method fromRetrySessionsince it can be easily be achieved usingwith unittest.mock.patch("socket.has_ipv6", False):.
Internal Changes#
Use the
geomsmethod for iterating over geometries to address the deprecation warning ofshapely.Use
importlib-metadatafor getting the version instead ofpkg_resourcesto decrease import time as discussed in this issue.Remove unnecessary dependency on
simplejsonand useujsoninstead.
0.11.5 (2021-09-09)#
Bug Fixes#
Update the code to use the latest
requsts-cacheAPI.
0.11.4 (2021-08-26)#
New Features#
Add URL for PyGeoAPI service.
0.11.3 (2021-08-21)#
Internal Changes#
Fix a bug in
WFS.getfeature_byidwhen the number of IDs exceeds the service’s limit by splitting large requests into multiple smaller requests.Add two new arguments,
max_nrecordsandread_method, toWFSto control the maximum number of records per request (defaults to 1000) and specify the response read method (defaults tojson), respectively.
0.11.2 (2021-08-19)#
Internal Changes#
Simplify the retry logic
ArcGISRESTFulby making it run four times and making sure that the last retry is one object ID per request.
0.11.1 (2021-07-31)#
The highlight of this release is migrating to use AsyncRetriever that can improve
the network response time significantly. Another highlight is a major refactoring of
ArcGISRESTFul that improves performance and reduce code complexity.
New Features#
Add a new method to
ArcGISRESTFulclass for automatically retrying the failed requests. This private method plucks out individual features that were in a failed request with several features. This happens when there are some object IDs that are not available on the server, and they are included in the request. In these situations the request will fail, although there are valid object IDs in the request. This method will pluck out the valid object IDs.Add support for passing additional parameters to
WMSrequests such asstyles.Add support for WFS version 1.0.0.
Internal Changes#
Migrate to
AsyncRetrieverfromrequests-cachefor all the web services.Rename
ServiceErrortoServiceUnavailableandServerErrortoServiceErrorSince it’s more representative of the intended exception.Raise for response status in
RetrySessionbefore the try-except block soRequestsExceptioncan raise, and its error messaged be parsed.Deprecate
utils.threadingsince all threading operations are now handled byAsyncRetriever.Increase test coverage.
0.11.0 (2021-06-18)#
New Features#
Add support for requesting
LineStringpolygon forArcGISRESTful.Add a new argument called
distancetoArcGISRESTful.oids_bygeomfor specifying the buffer distance from the input geometry for getting features.
Breaking Changes#
Drop support for Python 3.6 since many of the dependencies such as
xarrayandpandashave done so.Remove
async_requestsfunction, since it has been packaged as a new Python library called AsyncRetriever.Refactor
MatchCRS. Now, it should be instantiated by providing the in and out CRSs like so:MatchCRS(in_crs, out_crs). Then its methods, namely,geometry,boundsandcoords, can be called. These methods now have only one input, geometry.Change input and output types of
MatchCRS.coordsfrom tuple of lists of coordinates to list of(x, y)coordinates.ArcGISRESTfulnow has a new argument,layer, for specifying the layer number (int). Now, the target layer should either be a part ofbase_urlor be passed withlayerargument.Move the
spatial_relationargument fromArcGISRESTfulclass tooids_bygeommethod, since that’s where it’s applicable.
Internal Changes#
Refactor
ArcGISRESTfulBaseclass to reduce its code complexity and make the service initialization logic much simpler. The class is faster since it makes fewer requests during the initialization process.Add
pydanticas a new dependency that takes care ofArcGISRESTfulBasevalidation.Use persistent caching for all send/receive requests that can significantly improve the network response time.
Explicitly include all the hard dependencies in
setup.cfg.Set a default value of 1000 for
max_nrecordsinArcGISRESTfulBase.Use
dataclassforWMSBaseandWFSBasesince support for Python 3.6 is dropped.
0.10.1 (2021-03-27)#
Add announcement regarding the new name for the software stack, HyRiver.
Improve
pipinstallation and release workflow.
0.10.0 (2021-03-06)#
The first release after renaming
hydrodatatoPyGeoHydro.Fix
extentproperty ofArcGISRESTfulbeing set toNoneincorrectly.Add
feature typesproperty toArcGISRESTFulfor getting names and IDs of types of features in the database.Replace
cElementTreewithElementTreesince it’s been deprecated bydefusedxml.Remove dependency on
dataclassessince its benefits and usage in the code was minimal.Speed up CI testing by using
mambaand caching.ArcGISRESTFullnow prints number of found features before attempting to retrieve them.Use
loggingmodule for printing information.
0.9.0 (2021-02-14)#
Bump version to the same version as PyGeoHydro.
Add support for query by point and multi-points to
ArcGISRESTful.bygeom.Add support for buffer distance to
ArcGISRESTful.bygeom.Add support for generating ESRI-based queries for points and multi-points to
ESRIGeomQuery.Add all the missing type annotations.
Update the Daymet URL to version 4. You can check the release information here
Use
cytoolzlibrary for improving performance of some operations.Add
extentproperty toArcGISRESTfulclass that get the spatial extent of the service.Add URL to
airmapservice for getting elevation data at 30 m resolution.
0.2.3 (2020-12-19)#
Fix
urlib3deprecation warning about usingmethod_whitelist.
0.2.2 (2020-12-05)#
Remove unused variables in
async_requestsand usemax_workers.Fix the
async_requestsissue on Windows systems.
0.2.0 (2020-12-06)#
Added/Renamed three class methods in
ArcGISRESTful:oids_bygeom,oids_byfield, andoids_bysql. So you can query feature within a geometry, using specific field ID(s), or more generally using any valid SQL 92 WHERE clause.Added support for query with SQL WHERE clause to
ArcGISRESTful.Changed the NLDI’s URL for migrating to its new API v3.
Added support for CQL filter to
WFS, credits to Emilio.Moved all the web services URLs to a YAML file that
ServiceURLclass reads. It makes managing the new URLs easier. The file is located atpygeoogc/static/urls.yml.Turned off threading by default for all the services since not all web services supports it.
Added support for setting the request method,
GETorPOST, forWFS.byfilter, which could be useful when the filter string is long.Added support for asynchronous download via the function
async_requests.
0.1.10 (2020-08-18)#
Improved
bbox_decomposeto fix theWMSissue with high resolution requests.Replaces
simplejsonwithorjsonto speed up JSON operations.
0.1.8 (2020-08-12)#
Removed threading for
WMSdue to inconsistent behavior.Addressed an issue with domain decomposition for
WMSwhere width/height becomes 0.
0.1.7 (2020-08-11)#
Renamed
vsplit_bboxtobbox_decompose. The function now decomposes the domain in both directions and return squares and rectangular.
0.1.5 (2020-07-23)#
Re-wrote
wms_byboxfunction as a class calledWMSwith a similar interface to theWFSclass.Added support for WMS 1.3.0 and WFS 2.0.0.
Added a custom
Exceptionfor the threading function calledThreadingException.Add
always_xyflag toWMSandWFSwhich is False by default. It is useful for cases where a web service doesn’t change the axis order from the transitionalxytoyxfor versions higher than 1.3.0.
0.1.3 (2020-07-21)#
Remove unnecessary transformation of the input bbox in WFS.
Use
setuptools_scmfor versioning.
0.1.2 (2020-07-16)#
Add the missing
max_pixelargument to thewms_byboxfunction.Change the
onlyIPv4method ofRetrySessionclass toonlyipv4to conform to thesnake_caseconvention.Improve docstrings.
0.1.1 (2020-07-15)#
Initial release.