3

There are two shapefiles. And I have extracted those two data using geopandas file. and it was successful.

File 1 : 
zipfile_mobile = "zip://File Saved Location/2020-01-01_performance_mobile_tiles.zip"
mobile_tiles = gp.read_file(zipfile_mobile)

File : 2
zipfile = "zip://File Saved Location/tl_2019_us_county.zip"
counties = gp.read_file(zipfile)

enter image description here enter image description here

Now I want to look for the intersection of those data. while run the following command I'm getting the error message as below.

ky_counties = counties.loc[counties['STATEFP'] == '21'].to_crs(4326)

But when I do the following error has occurred.

Spatial indexes require either `rtree` or `pygeos`. See installation instructions at https://geopandas.org/install.html

But already rtree has been installed.

enter image description here

Python: 3.9.1

Also, note that the following libraries are already imported.

import geopandas as gp
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

from shapely.geometry import Point
from adjustText import adjust_text
import rtree
viththi
  • 161
  • 3
  • 9

1 Answers1

1

After I remove ".to_crs(4326)" from the below code, then code execution succeeded.

ky_counties = counties.loc[counties['STATEFP'] == '21'].to_crs(4326)

The same CRS can often be referred to in many ways. For example, one of the most commonly used CRS is the WGS84 latitude-longitude projection. This can be referred to using the authority code "EPSG:4326". It means no need for this conversion in this case.

viththi
  • 161
  • 3
  • 9