How to parse parcel data #3482
Replies: 4 comments
|
Not sure I follow what you are trying to do here. Are the parcel data only available as DWG format, or are they also available in a more GIS-friendly format that definitely includes the correct CRS of parcel data? I haven't ever worked with DWG files, but it looks like maybe they don't have good support for CRS when read using GDAL: docs, which is what you are ultimately using via Among other things, I'd suggest translating the DWG file into a more GIS friendly format (e.g., Flatgeobuff / GPKG are good options) via In terms of slowness to run, it could be from a few things:
Make sure to check out sjoin for doing an index-accelerated spatial join (if you want this as a spatial join) or use the spatial index query operation if you are trying to manage that more directly. Either way, you need to build a spatial index of the parcels, and then query that spatial index using the bounding rectangle of your lines from KML. However, since you are dealing with a massive parcel dataset (>3M features), reading those data into memory and then building a spatial index will take some time and quite a lot of memory. An alternative way to go about that would be to 1) convert the data into a GIS format that has a built-in spatial index (Flatgeobuff, GPKG, etc), and 2) select out only the data you need using the |
|
So the data is a DWG that I export to DXF. The correct CRS is 4326 but when I set it as 4326 I get an error (ValueError: aspect must be finite and positive) when using plot so I brought it in as 3857 then convert it into 4326 and that works for some reason. I'll try and find a good way to convert the DXF/DWG to a more GIS friendly format and check back in. The only issue I have with this is that I need to put it back into AutoCad DWG format so I was hoping to avoid another projection problem later. |
|
FYI - It looks like DWG is not supported for writing in GDAL, but DXF is; see: GDAL vector drivers. |
|
I figured out the problem was that I had the wrong EPSG I found a shape file and a geojson and when I imported them the region was different so I changed it in the DXF version and it worked. I still think that using the GIS version will be important though because it should save time which will be crucial when I place the parcels back in. (I was working on a reduced version for times sake) |
Not sure I follow what you are trying to do here.
Are the parcel data only available as DWG format, or are they also available in a more GIS-friendly format that definitely includes the correct CRS of parcel data? I haven't ever worked with DWG files, but it looks like maybe they don't have good support for CRS when read using GDAL: docs, which is what you are ultimately using via
read_filein GeoPandas. To get around that, you'll need to set the CRS after reading the parcel data; do you know for certain that 3857 is the correct CRS of those source data? (it would be an odd choice for authoritative data like parcels)Among other things, I'd suggest translating the DWG file into a more GIS…