Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Napa County #11

Merged
merged 3 commits into from
Oct 26, 2020
Merged

Adding Napa County #11

merged 3 commits into from
Oct 26, 2020

Conversation

miloconway
Copy link

Following the same format as that done for Solano County. However ran into a wrinkle - the coordinate system from the shp file doesn't seem to be long-lat and not quite sure how to work with it.

The input data file contains an associated XML file for the SHP that has the following:

<coordRef>
<type Sync="TRUE">Projected</type>
<geogcsn Sync="TRUE">GCS_North_American_1983</geogcsn>
<csUnits Sync="TRUE">Linear Unit: Foot_US (0.304801)</csUnits>
<projcsn Sync="TRUE">NAD_1983_StatePlane_California_II_FIPS_0402_Feet</projcsn>
<peXml Sync="TRUE"><ProjectedCoordinateSystem xsi:type='typens:ProjectedCoordinateSystem' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/10.7'><WKT>PROJCS[&quot;NAD_1983_StatePlane_California_II_FIPS_0402_Feet&quot;,GEOGCS[&quot;GCS_North_American_1983&quot;,DATUM[&quot;D_North_American_1983&quot;,SPHEROID[&quot;GRS_1980&quot;,6378137.0,298.257222101]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.0174532925199433]],PROJECTION[&quot;Lambert_Conformal_Conic&quot;],PARAMETER[&quot;False_Easting&quot;,6561666.666666666],PARAMETER[&quot;False_Northing&quot;,1640416.666666667],PARAMETER[&quot;Central_Meridian&quot;,-122.0],PARAMETER[&quot;Standard_Parallel_1&quot;,38.33333333333334],PARAMETER[&quot;Standard_Parallel_2&quot;,39.83333333333334],PARAMETER[&quot;Latitude_Of_Origin&quot;,37.66666666666666],UNIT[&quot;Foot_US&quot;,0.3048006096012192],AUTHORITY[&quot;EPSG&quot;,2226]]</WKT><XOrigin>-115211800</XOrigin><YOrigin>-93821500</YOrigin><XYScale>36983428.057351544</XYScale><ZOrigin>-100000</ZOrigin><ZScale>10000</ZScale><MOrigin>-100000</MOrigin><MScale>10000</MScale><XYTolerance>0.0032808333333333331</XYTolerance><ZTolerance>0.001</ZTolerance><MTolerance>0.001</MTolerance><HighPrecision>true</HighPrecision><WKID>102642</WKID><LatestWKID>2226</LatestWKID></ProjectedCoordinateSystem></peXml>
</coordRef>

This probably contains the info needed to translate the coordinates but not sure how to use it

@miloconway
Copy link
Author

OK, figured out the coordinate system translation, updated.

Generated file: https://drive.google.com/file/d/14ec-92Fmkn-VL5QrzL3T0tDVMZ2_2tjN/view?usp=sharing

@miloconway miloconway changed the title WIP on adding Napa County Adding Napa County Oct 26, 2020
app/index.html Show resolved Hide resolved
scrapers/napa/parse.py Outdated Show resolved Hide resolved
scrapers/napa/scrape.py Outdated Show resolved Hide resolved
@typpo
Copy link
Owner

typpo commented Oct 26, 2020

This is looking great!

The XY coordinates are CA State Plane coordinates at Napa is in Zone 2 (ESPG 2226):

from pyproj import Transformer

# California Zone 2
# https://epsg.io/2226
transformer = Transformer.from_crs(2226, 4326)

# ....later on in your parcel loop....
lat, lng = transformer.transform(y_coord, x_coord)

You may have to swap x/y lng/lat. I've seen the order of the coordinate vary between datasources.

Hope this helps 👍

@miloconway
Copy link
Author

@typpo yup! i examined the generated geojson output for the default output and previously working samples and figured out how to get it working, the code and the linked g-drive data in the subsequent comment should work!

@typpo
Copy link
Owner

typpo commented Oct 26, 2020

Oops, I totally missed that. Merging & updating the data now!

@typpo typpo merged commit c3dfd40 into typpo:master Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants