I have an error in QGIS that I cannot seem to figure out. I have a zip-code level shapefile from the U.S. Census. I'm merging that with a data file by zip of counts. I want to make a dot density shapefile using the Random Points ftool. However I get a pesky error message as follows:

"Too many features couldn't be calculated due to conversion error. Please check out message log for more infor"

I've seen the underlying Python code where this error message is created, but I can't seem to find the source. The message log shows the following

2016-03-21T23:50:23 0   QGIS Ready!
2016-03-22T00:05:17 1   WARNING - fTools: Random Points
2016-03-22T00:05:17 1   The following feature ids should be checked.
2016-03-22T00:05:17 1   Feature id: 33143
2016-03-22T00:05:17 1   Feature id: 33143
2016-03-22T00:20:04 1   End of features to be checked.

There are many lines in between the dot continuations. So First off, I'm not sure how to check the Feature referenced, as I'm not sure what that feature is. Without knowing something about the source of the error, I'm not sure how to proceed.

A couple of thoughts. The number of points crammed into a zipcode can be as high as 493. I doubt having too many points in a polygon can create that, but just throwing it out there. Second, most zipcodes are null values. Third, the original Census zipcode polygons were clipped to exclude water along the ocean coasts and the great lakes. Other than that I'm at a loss.

  • One additional thing, the counts field is set to integer.
    – Steve
    Mar 22 '16 at 4:50
  • Do all the warnings refer to the same feature? (Feature id: 33143) Mar 22 '16 at 4:54
  • There is a simple way to find a feature (point, polygon,...) by id: open the field calculator for your layer, check "Create a new field". In the "Expression" field, just write $id, then click "OK". You'll get a new field, with the id of each feature. Hopefully it will help to identify the issue.
    – ArMoraer
    Mar 22 '16 at 8:16
  • Hasan Mustafa, yes, all warnings reference the same feature. ArMoraer, I see, so the feature ID refers to a record. I will definitely check this out. Thanks both of you for your help.
    – Steve
    Mar 22 '16 at 13:32
  • Following Armoraer, I found that feature ID 33143 is the last record in the zipcode shape file (.dbs). So for some odd reason, it gets stuck on this last record and will not complete. I observed the last record and there is nothing unusual about it. It's an interior zip code with only one random dot to generate. So, I'm still not making headway.
    – Steve
    Mar 22 '16 at 16:12

Well, I started to write a long post analyzing the source code of Random Points, then I realized you wrote "Second, most zipcodes are null values". If you mean that some of your polygons (aka features or records) have a NULL value in the count field (i.e. the field you specified in the following image), then this is the issue. You have to replace all these NULLs with 0s.

Fortunately, this is quite simple: open the Field Calculator and write the following expression: if( "COUNT" IS NULL, 0, "COUNT" ) (replace COUNT with the actual field name). Don't forget to check "Update existing field" if you don't want to create a new field.

With a bit of luck, this should do.

  • Good catch. Also make sure that there are no records without a geometry in the zip file...those can cause the whole thing to hang as well Mar 25 '16 at 11:42
  • It appears that ArMoraer's solution worked. Many thanks to both of you for your suggestions.
    – Steve
    Mar 26 '16 at 0:56
  • @Steve : I'm glad your problem was solved. Please consider accepting my answer by clicking on the grey checkmark below the answer's score.
    – ArMoraer
    Mar 26 '16 at 7:28

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.