hauke96 / GeoNotes

A simple app to create georeferences notes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More fields for a point (Name, Time, Group)

OmlineEditor opened this issue · comments

now there are only coordinates and a description of the car. there is not even a name, when exporting names are replaced with numbers, it is not convenient.

please add a name, for export it will be like:
<name>POI Name</name>

please add the creation time, for export it will be like
<time>2022-01-28T23:12:51Z</time>

please add a type or group, for export it will be like
<type>group of attractions</type>

the group will also be used in #21

Hi, thanks for this feature request.

The GPX specification unfortunately has no ID field, that's why I put the ID of the note into the name field and use the description field for the content of the note. I wouldn't change this as the name should be unique since it's used as a de-facto ID by a lot of applications. In fact I read somewhere that it actually must be unique, but I guess that's not enforced by the GPX specification.

The time is in deed missing, I'll add this.

The category (I think that's what you mean by "type or group"?) will be added as soon as there are categories, which is currently not the case.

type or group or category - it's the same thing, too, just different names, I just don't know which name is correct

for a unique name, you can check the existing name and if there are repetitions then rename to the name (1)
I ask you to add the name field. without it, when exporting, names are obtained from numbers, and this is inconvenient, I have to rename them

The thing is that there needs to be a unique identifier. The ID of the note from the GeoNotes app is already unique. The name-attribute in the GPX file is the best candidate for an unique identifier, as it makes the most sense to put it in there and a lot of applications expect it there. Therefore I'll keep putting the note ID in the name field. Renaming the content of the note just to make it unique is not a solution I'll implement.

On Linux switching name and desc fields in the GPX file is one line of commands: cat input.gpx | sed "s/<\(\/\?\)name>/<\1tmp>/g" | sed "s/<\(\/\?\)desc>/<\1name>/g" | sed "s/<\(\/\?\)tmp>/<\1desc>/g" > output.gpx MacOS probably understands this command as well and Windows might have alternative commands. Removing the name attribute and renaming the desc attribute is even shorter and just needs two sed commands instead of three.

Just out of curiosity: What's your use case here, so what are you doing with the GPX files?

what unique ID are you talking about? about the Name field?

my usage is as follows: make labels in your program and then export them to another program. but in your program, only the description field is available and there is no field for name. when exporting to another program , I get numbers for POI points for the place of the name . if you are talking about the uniqueness of the name, make your program say that there is already such a name if the user enters a duplicate name or let it rename atomically to name (1)

Well, the name field does exist in the GPX file. See this extract I just created:

<?xml version="1.0" encoding="UTF-8"?><gpx version="1.1">
<wpt lat="53.5543265223342" lon="9.990269079241273"><name>1</name><desc/></wpt>
<wpt lat="53.551451243296334" lon="9.993348588416836"><name>3</name><desc>Restaurant "Yummi"</desc></wpt>
...
</xml>

As you can see, the name field is set and contains the ID of the note. The ID is automatically generated in the GeoNotes app, so the user cannot change or set it within the app. The desc field then contains the content of the note which was entered by the user.

I will not change the entered text by appending a counter like "(1)" or something similar, just to make it unique. It doesn't really make sense since there's already a unique ID for each note.

I'll stick to the current format: name contains the ID of the note and desc the entered text. It's simple and straight forward. I recommend you to do manual preprocessing (as my Linux command line example shows) if this general purpose format doesn't fit your needs.

manual processing is very inconvenient. try exporting this record of yours to OsmAnd. in this program you will see that the names of the dots consist of numbers. and there are only normal names in the note.

see how the export from the program takes place OsmAnd.

do you think that numbers in names are normal?

I admit that it's inconvenient but GeoNotes is not meant to be an GPX editor or something. It wasn't and still isn't a goal to be fully interoperable with other applications. The export function was initially implemented to create a backup at all. The formats GeoJSON and GPX were chosen to easily read that backup in case the app looses all data, you wiped your phone, app is reinstalled, etc.

Of course this functionality can be used to misuse GeoNotes as a GPX editor and to use other apps to work on that GPX data, but again: This is a misuse of GeoNotes. It's fine with me but don't expect everything to work fluently. What tools you use and how you use the data, is completely up to you.

Regarding the GPX format: I personally would expect the ID of the note in an id field of the GPX file. The GPX spec doesn't contain an id field, so name is IMHO the next best option. I would not expect the ID to be the description of a waypoint and therefore will not put it into the desc field.

That's it about that.

OsmAnd itself offers the possibility to create notes and export them as GPX, so that's one option you have. Preprocessing is another option. Furthermore, creating a fork of GeoNotes is yet another possibility for you. Feel free to copy this repo and change the code in any way that works for you.

you are right, you have no compatibility with other programs and this is a very big problem. I suggest solving it and increasing compatibility. to do this, you need to expand the functionality. please think about it.

Added the time field in d276ed4.