-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Expose Object index from OCAD as GeoJson property #25
Comments
Hi, thanks for the suggestion! It sounds like a very good idea to use the same id (or index) as OCAD uses. However, looking at the OCAD file format specification (https://www.ocad.com/wiki/ocad/en/index.php?title=OCAD_12_File_Format#Objects), it's not clear to me what property the index is. Just guessing, but it might be that the index is actually the object's index in the Object Index structure. That should be fairly straight forward to use, we only need to figure out what ids to assign to features created for symbol elements. |
@aopheim @jmacura continuing the discussion here... since I don't have OCAD (or Windows) myself, can you verify that this "Object Index" in OCAD is indeed stable between different versions of a map? I dug through the spec to figure out what property this might be, but can't really figure it out. As mentioned in my previous comment, we could just use the object's index within the file, but I'm not sure if that would be stable when the file is changed (I would assume they wouldn't be if objects are removed from the map for example). |
As a quick test, I have created f0da7d6 which stores each object's index and outputs it in the GeoJSON. From a quick test with a map I have, it does unfortunately not look like that index is stable between changes. |
Thanks for your effort, @perliedman !
By comparing the two GeoJSON outputs, it is obvious, that the IDs are not preserved. Other objects' IDs got renumbered after the deletion. |
@jmacura thanks for trying it out, that looks like the results I saw as well. Would it be possible for you to check in OCAD if the object id shown there was stable between those changes? |
I wanted to check, but even after long search I haven't found any place where the object ID is exposed in the OCAD's GUI. Creating a new dBase database file from OCAD creates an empty table. So, I do not know how to check otherwise... 😞 |
I see now that all objects are given a numeric id after being parsed into GeoJson. However, we have no guarantee that the same object in the map gets the same id after edits have been made in the map, as the id is just set as 1 -> n when the map has been parsed.
After some research I see that OCAD has its own "Object index", briefly explained here. https://www.ocad.com/wiki/ocad/en/index.php?title=Select#Select_Object_by_Object_Index
I have made some small tests, and it seems like this is a numeric id given in the order objects are added to the map. Meaning it will remain the same and make it possible to identify the same object across different versions of the map.
Would it be possible to expose the object id as a property of a GeoJson Feature?
It may be that this is already available, as I see the OcadFile object has a property objIndex. However, I see no properties in that object that gives me the id.
![image](https://private-user-images.githubusercontent.com/37472517/292432653-20626e2f-f510-4089-8de7-9c450f158f95.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwOTExNTQsIm5iZiI6MTcyNjA5MDg1NCwicGF0aCI6Ii8zNzQ3MjUxNy8yOTI0MzI2NTMtMjA2MjZlMmYtZjUxMC00MDg5LThkZTctOWM0NTBmMTU4Zjk1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDIxNDA1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUxMTc2NTkwYmQ5NDVhOGYxNjUzYjEwODNiNTcyMmVkNzkyZTk1Y2FlZWI3YzE2YzU2MmNiNjY1ZmQ0NDYyMzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-oOApNTcgyNOORVaU0N4kViUtFI_lpW7fk6lfLxgLHY)
If the object index is not easily available, do you maybe have suggestions of other ways to identify the same map object between different versions? I have tried using a combination of type and creationDate, but that is not unique, as the creation date will be the same across objects if you import objects (importing contours for example).
The text was updated successfully, but these errors were encountered: