Error on feat.centroid line 572 in ArcGISPro 3.6, LM 3.2.0

25 views
Skip to first unread message

Marie-Amélie Bélanger

unread,
May 22, 2026, 10:50:31 AM (2 days ago) May 22
to Linkage Mapper
Hi all, 
I am getting this error in Linkage Mapper 3.2.0 (yes its really 3.2.0 even if it says 3.1.0 in the error message) run in ArcGIS Pro 3.6

Creating shapefiles with linework for links.

---------------------------------
Python error on **line 572** of lm_util.py in Linkage Mapper Version 3.1.0:
SystemError: error return without exception set

The line in question is highlighted in yellow here:
I ran the Polygon to Point tool to create centroid manually in arcGIS Pro in my layer and it all works well.

Thank you for your help!

def get_centroids(shapefile, field):
    """Returns centroids of features"""
    try:
        pointArray = npy.zeros((0, 3), dtype="float32")
        xyCumArray = npy.zeros((0, 3), dtype="float32")
        xyArray = npy.zeros((1, 3), dtype="float32")
        rows = arcpy.SearchCursor(shapefile)
        row = next(rows)
        while row:
            feat = row.shape
            center = feat.centroid
            center = str(center)
            xy = center.split(" ")
            if "," in xy[0] or "," in xy[1]:
                msg = ('ERROR: It appears that your region settings are not in '
                        'USA format (decimal commas are used instead of decimal '
                        'points). '
                    'Please change your region settings in Windows to English (USA) or '
                    'another convention that uses decimal points.  You may need to'
                    'modify the coordinate system of your input files as well.')
                raise_error(msg)
            xyArray[0, 0] = float(xy[0])
            xyArray[0, 1] = float(xy[1])
            value = row.getValue(field)
            xyArray[0, 2] = int(value)
            xyCumArray = npy.append(xyCumArray, xyArray, axis=0)
            row = next(rows)

John Gallo

unread,
May 22, 2026, 12:39:50 PM (2 days ago) May 22
to linkage...@googlegroups.com
Hi Marie-Amelie,

It is great to know you saw the message about v 3.2 Beta and are giving it a test on 3.6.

I think the error in this case could be that you are using commas instead of decimal points (periods) in numbers.  

I say this because I see the following in your error message:


" msg = ('ERROR: It appears that your region settings are not in '
                        'USA format (decimal commas are used instead of decimal '
                        'points). '
                    'Please change your region settings in Windows to English (USA) or '
                    'another convention that uses decimal points.  You may need to'
                    'modify the coordinate system of your input files as well.')"


Maybe change the region settings and try again and let us know if that does not fix the problem?  (or reply either way  :)

Thank you,

John

P.S. And, if you have a chance, is this a new instance of this error?  In other words, have you been running v 3.1 before on ArcPro 3.5 or earlier with these comma regional settings?

--
You received this message because you are subscribed to the Google Groups "Linkage Mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linkage-mappe...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/linkage-mapper/7ff08b61-78f2-48ef-92e0-0d7e9f69aa51n%40googlegroups.com.


--
John A. Gallo, Ph.D.
President and Science Director, Regional Resilience Network

Marie-Amélie Bélanger

unread,
May 22, 2026, 12:45:46 PM (2 days ago) May 22
to linkage...@googlegroups.com
Hi, thanks for the quick reply. 
It is a new installation. I haven't run LM 3.1 before.
I did get the error about the regional settings at first though and changed them to point instead of comma in Windows regional settings already. So unless there is another setting for decimal markers somewhere I don't think it is the issue here.

Thanks for your help



You received this message because you are subscribed to a topic in the Google Groups "Linkage Mapper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linkage-mapper/ewHfnvEgTVo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linkage-mappe...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/linkage-mapper/CAEUWjEsB3Teta604T0wQPhxLXtgxNQ8NXNLvBoyiHBR7ZrxYBQ%40mail.gmail.com.

John Gallo

unread,
May 22, 2026, 1:21:11 PM (2 days ago) May 22
to linkage...@googlegroups.com
Hi Marie-Amelie,

It is saying there is a comma in your xy coordinates where it wants a period, so that is a clue. Maybe it is a setting in ArcPro that needs to be changed also?  

If no please reply to me directly with the full log file and we'll get it solved.  We'll aim to report back to the group if the issue is not specific to the comma vs period issue.  (At some point it would be great to program the workaround so it works both ways....)

Thanks,

John

On Fri, May 22, 2026 at 10:50 AM Marie-Amélie Bélanger <m-a.be...@horizonnaturebsl.org> wrote:
--
You received this message because you are subscribed to the Google Groups "Linkage Mapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linkage-mappe...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/linkage-mapper/7ff08b61-78f2-48ef-92e0-0d7e9f69aa51n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages