GeoJSON or GML import

Hello Community,
I have a GeoJSON file download from a DHIS2 Instance. I tried to import it into another instance with the same OU IDs, but it doesn’t work.
Attached are the report image captures:

Hi @dkande

What version of DHIS2 is your instance running? And what is the version of the Maps app (you can find out from the App Management app)?

I used play and I can see a dropdown to select the ‘Store geometry as value of attribute’. You can see for yourself, DHIS 2 Demo - Sierra Leone . Maybe if it’s not showing then it could be a cache issue, so would you try again using your browser’s Guest mode ( Browse Chrome as a guest - Computer - Google Chrome Help)?

Thanks!

Hi @Gassim ,
I use version 2.40.1 for DHIS2 and Version 100.2.2 for the Map application.
I also changed my browser, but the catchment area is still not displayed.
I did the test with the play it worked.

Thanks

1 Like

Hi @dkande

Were you able to resolve this? I’m not sure how come it worked on play but not your instance. Is the issue with importing or with the catchment area not displaying?

When importing (before starting dry run) could you open the Network tab and Console on the DevTools? After running it please see if there are any errors.

Thanks!

Is this issue already fixed?

I installed DHIS2 v40.3.0 on my windows 11 machine.
I created a GeoJson file.
When I try to import the GeoJson file into " Organisation unit geometry import" feature, it always returns the same error “One attribute must be selected”.

How can I procede?

Hi @Walter_Sono

I’m not able to reproduce this issue (see recording), but I assume that the reason you’re seeing the issue is because the property name is Organisation unit with the space and not including name because if we look at the GeoJSON file the id that references the OU is using that property.

Would you please insert in GeoJSON property name Organisation Unit instead of the organizationUnitName and see if that works?

Thanks!

Unfortunately, I got the same error.

Do you think that maybe this has to do with the version of DHIS2?

What does “One attribute must be selected?” means?


I see some values are missing. I’m guessing most probably in the coordinates, you must mention the “type” (but maybe some of the “properties” are required as well), please see screenshot example:

I prepared my geojson file using geojson.io webapp.

It is a polygon mapping a whole country. It looks like yours is a single point referring to a location of a person.

It already contains a type of property in the geometry property, it is below the array of coordinates.

Please see in the attachment.
geojson_file_v2

The error that you are reporting is normally related to the option “Import as associated geometry”. Did you by chance select that option?

It would be helpful if you could upload a video showing the error being generated.

Hi Jennifer.

No, I haven’t selected “import as associated geometry”.

Here is the link to the video: WhatsApp Video 2024-02-27 at 11.43.15 AM.mp4 - Google Drive

Hmm, I’m not able to generate the error. Does your geojson looks exactly like the screenshot you shared above? In particular, the id is of number type (not in quotes), and “properties” is an empty object? Are there any other differences (ignoring coordinate values)?

i.e.,

{
    "type": "FeatureCollection",
    "organisationUnit": "Mocambique",
    "features": [
        {
            "type": "Feature",
            "properties": {},
            "id": 0,
            "geometry": {
                "coordinates": [
                    [
                        [
                            -11.231383687940706,
                            9.9898480782023
                        ],
                        [
                            -12.637121095074235,
                            9.530970056246233
                        ],
                        [
                            -11.231383687940706,
                            9.9898480782023
                        ]
                    ]
                ],
                "type": "Polygon"
            }
        }
    ]
}

Yes it looks like that.

I am using DHIS2 v2.40.3.

Sorry, I’m unable to reproduce the issue you are having. Go ahead and submit a Jira issue and include a sample of the geojson, screenshots with the developer console open, so that any javascript or loading errors are shown. Also, if you could make a screen recording showing the error being generated, that would be helpful.

@jen.jones.arnesen we are encountering the same issue at PEPFAR, and I was able to determine the cause, and how to replicate it in play.dhis2.org - here is the jira ticket: [DHIS2-17071] - Jira

To replicate, the instance should have no attributes of type geojson associated with organization unit metadata object type. I suppose in case of Walter, it is the same as with us at PEPFAR, and unlike play.dhis2.org, which has catchment area attribute, we don’t have any geojson attributes. The issue is with the import app - even if we are not importing as associated geometry, the app is erroring if there are no attributes at all, and the workaround is to create the attribute even if not using it or resorting to using API directly and bypassing the app.

1 Like

Thank you @Vladimer_Shioshvili.

I use this “workaround” and I was able to bypass the error.

I don’t know if it is a workaround, or it is supposed to be like that.

1 Like