Skip to content

Commit

Permalink
Merge pull request #151 from ljwolf/b150
Browse files Browse the repository at this point in the history
Fix breaking issue in tiger query processing
  • Loading branch information
ljwolf authored Sep 22, 2022
2 parents f767140 + 29f2cb6 commit 63d368e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cenpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.0.0post3"
__version__ = "1.0.1"
__author__ = "Levi John Wolf [email protected]"

from . import explorer
Expand Down
12 changes: 6 additions & 6 deletions cenpy/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ def from_place(

env_layer = self._api.mapservice.layers[env_name.name]
if place_type == "County Subdivision":
placer = "STATE={} AND COUSUB={}".format(
placer = "STATE='{}' AND COUSUB='{}'".format(
placerow.STATEFP, placerow.TARGETFP
)
else:

placer = "STATE={} AND PLACE={}".format(placerow.STATEFP, placerow.TARGETFP)
placer = "STATE='{}' AND PLACE='{}'".format(placerow.STATEFP, placerow.TARGETFP)
env = env_layer.query(where=placer)

print(
Expand All @@ -219,7 +219,7 @@ def from_place(
replace_missing=replace_missing,
)
if strict_within:
geoms = geopandas.sjoin(geoms, env[["geometry"]], how="inner", op="within")
geoms = geopandas.sjoin(geoms, env[["geometry"]], how="inner", predicate="within")
if return_bounds:
return (geoms, data, env)
return geoms, data
Expand Down Expand Up @@ -258,7 +258,7 @@ def _from_bbox(
# filter the records by a strict "within" query if needed
if strict_within:
involved = geopandas.sjoin(
involved, env[["geometry"]], how="inner", op="within"
involved, env[["geometry"]], how="inner", predicate="within"
)

# Construct a "query" translator between the GeoAPI and the Census API
Expand Down Expand Up @@ -348,7 +348,7 @@ def _environment_from_layer(
cache_name = layername_match.target.lstrip("(ESRILayer) ")
row = self._cache[cache_name].loc[item_name.name]
return layer.query(
where="GEOID={}".format(row.GEOID), geometryPrecision=geometry_precision
where="GEOID='{}'".format(row.GEOID), geometryPrecision=geometry_precision
)

def _from_name(
Expand Down Expand Up @@ -386,7 +386,7 @@ def _from_name(
replace_missing=replace_missing,
)
if strict_within:
geoms = geopandas.sjoin(geoms, env[["geometry"]], how="inner", op="within")
geoms = geopandas.sjoin(geoms, env[["geometry"]], how="inner", predicate="within")
if return_bounds:
return geoms, data, env
return geoms, data
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
with open(init, "r") as initfile:
firstline = initfile.readline()
init_version = firstline.split("=")[-1].strip()
init_version = init_version.replace("'", "")
init_version = init_version.replace('"', '')

with open(os.path.join(basepath, "README.rst"), "r") as readme:
long_description = readme.readlines()
Expand Down

0 comments on commit 63d368e

Please sign in to comment.