2

I have a point feature layer with ~240,000 parcel centroids. I have a second feature layer containing ~9000 subdivision polygons. I want to assign the name of the associated subdivision as a new field to each point in the parcel centroid layer. The polygon layer is a shapefile containing a single field, the subdivision name. The point layer is a csv file containing 3 fields - the parcel ID, lat, lon and is loaded using layer->Add Delimited Text Layer.

The polygon layer is in WGS84/EPSG:4326. I have explicitly set the point layer to the same CRS. Everything looks sane on the map. I then try to do a spatial join: Vector->Data Management Tools->Join Attributes by Location. I set the target layer to the point layer, the join vector layer to the polygon layer. I set attribute summary to "Take attributes of first feature". I set the output shape file and click OK. I immediately get a warning message that the two layers have different CRS. But I have verified that are both EPSG:4326, as is the project CRS. I click OK and the progress bar immediately shows 15% and then life comes to a halt. The task monitor shows qgis running at 100% of CPU, but after several hours, it's still running at 100%, and the progress bar has not updated. I spatially indexed both layers.

Why did I get the different CRS message?

Why is this taking so long to run? (qgis 2.0.1 Dufour, Windows 7/64bit, Intel i7 2.4GHz)

Is there a better/different approach I should try?

Edit: For what it's worth, ArcMap 10.2 did the spatial join in about 15 minutes (rough estimate - I wasn't actually timing it.)

If anyone wants to try this join, the data can be found here

  • I get this all the time and being new to QGIS still I would be interested in a clinical answer. As a workaround I save the target layer as a new Shapefile and specify the CRS again to that of the join layer and it usually works. – Morgan Ellingham Jan 29 '14 at 6:18
  • I killed the job after 12 hours with no progress showing on the progress bar. – Llaves Jan 29 '14 at 22:33
  • Storing the CSV in a database before running the job might be a good idea. – AndreJ Jan 30 '14 at 5:16
  • stored the csv as a shapefile, made no difference. – Llaves Jan 30 '14 at 15:40
1

How did you set the CRS of the point layer?

Rightclick -> Save As ... into another file with a different CRS is the only method working correct.

If you are unsure, turn on-the fly reprojection off. The layers must still overlap then.

  • Originally I just did a Rightclick->set crs, but I tried again as Morgan Ellingham wrote in the comments, and while that removes the warning about different CRS, the join still seems to hang. I allowed it to run for 12 hours and the progress bar hasn't changed and the program appears in the task monitor as "not responding". – Llaves Jan 29 '14 at 15:35
  • What is the CRS of a layer that has been added via Add Delimited Text Layer? The csv file has no CRS, of course, and the dialog contains no place to set a CRS. I would have guessed it would default to the CRS of the project, but apparently it is treated as having no CRS at all. – Llaves Jan 29 '14 at 15:37
  • In Settings -> Options, CRS tab you can choose to be asked for the CRS of new layers. – AndreJ Jan 29 '14 at 16:10
  • My project CRS was WGS84/EPSG:4326. The options setting for new layers is to use the project CRS. The other layer I was joining with was WGS84, yet I still got the warning when attempting the join until I saved the layer as a shapefile and re-loaded. – Llaves Jan 29 '14 at 22:35
  • 1
    Can you save the CSV point layer as a new shapefile, with the right CRS, and try again? Maybe for a subset if it takes too long? Just an off the cuff hunch but it might be a spatial indexing type thing with the large-ish amount of points. Also, it might be a good idea to investigate spatial database options. – Morgan Ellingham Jan 29 '14 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.