Skip to content
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

Core OSHDB classes need javadoc #70

Open
SlowMo24 opened this issue Feb 5, 2019 · 7 comments
Open

Core OSHDB classes need javadoc #70

SlowMo24 opened this issue Feb 5, 2019 · 7 comments
Assignees
Labels
documentation Readmes, Javadoc, Tutorials, etc.

Comments

@SlowMo24
Copy link
Contributor

SlowMo24 commented Feb 5, 2019

For unexperienced developers this: https://github.com/GIScience/oshdb/blob/master/oshdb/src/main/java/org/heigit/bigspatialdata/oshdb/osh/OSHRelation.java#L306 needs to get javadoc!

A) is this the right way to create an OSHEntity (in this example Type: Relation)
B) What are "nodes" and "ways"? All ways that were ever part of of the OSHRelation or just the current ones?

@rtroilo
Copy link
Member

rtroilo commented Feb 6, 2019

A.) Yes, for the current version this is the right way to create an OSHEntity.

long id = osm_id;
List<OSMRelations> versions = ...;
List<OSHNode> relationNodes = ...;
List<OSHWay relationWays = ...;
long baseId = 0L;
long baseTimestamp = 0L;
long baseLongitude = 0L;
long baseLatitude = 0L;
ByteBuffer record = OSHRelation.buildRecord(id, relation, relationNodes, relationWays,baseId, baseTimestamp, baseLongitude, baseLatitude);

B.) this question is a little bit confusing. What are the "just the current ones", for an OSHRelation?

@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Feb 6, 2019

A) could you please point me to where I can find the OSHRelation.buildRecord() method? Am I missing something? I was looking at

OSHRelation oshr=OSHRelation.build(List<OSMRelation> versions,Collection<OSHNode> nodes, Collection<OSHWay> ways)

B) that is also where I need clarification: what is meant by e.g. Collection nodes? The OSHObject of the Nodes being part of the Relation or also those that might have bin deleted over time (i.e. in earlier version of the the OSHRelation)?

@rtroilo
Copy link
Member

rtroilo commented Feb 6, 2019

A), this is basically the same as the code snippet I show you. buildRecord is a new version in an side branch, but it is the same as build.

B) we talk about OSHObjects, H for history, so all information over time are relevant :-) in this case, all OSHNodes (which are or were part of the OSHRelation as member) and all OSHWays (which are or were part of the OSHRelation as member)

@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Feb 6, 2019

👍 thanks for clarification. I will leave it open because javadoc is still missing (and promised with new version 😂 )

@tyrasd tyrasd changed the title urgently needed javadoc missing OSHRelation class needs javadoc Feb 6, 2019
@tyrasd
Copy link
Member

tyrasd commented Feb 6, 2019

(please try to use more specific issue titles 🙏 )

@SlowMo24 SlowMo24 changed the title OSHRelation class needs javadoc Core OSHDB classes need javadoc Feb 6, 2019
@SlowMo24
Copy link
Contributor Author

SlowMo24 commented Feb 6, 2019

Sorry for coming back again. Maybe I am not getting this right again, but aren't we doubling things here?

Each element of
List<OSMRelation> versions
fed to the builder contains an element
OSMMember[] refs
. Each value of that array in turn contains an element
OSHEntity entity
. So IF I get this right the exact content of
Collection<OSHNode> nodes
is already present within
List<OSMRelation> versions
and the user has to provide the same information twice?

@rtroilo
Copy link
Member

rtroilo commented Feb 6, 2019

Not necessarily, OSMMember.getEntity() could be null and it fact it is null, in the moment of an import. That's the reason for the separate list. But yes, if you get a new version for an relation, you could get all OSHNodes/Ways out of the members of the OSHRelation but only if the new version do not introduce an new member.

@SlowMo24 SlowMo24 added this to the OSHDB v0.6.0 milestone Mar 7, 2019
@SlowMo24 SlowMo24 added the documentation Readmes, Javadoc, Tutorials, etc. label Mar 7, 2019
@tyrasd tyrasd modified the milestones: release 0.6.0, release 1.0 Dec 2, 2020
@tyrasd tyrasd removed this from the release 1.0.0 milestone Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Readmes, Javadoc, Tutorials, etc.
Projects
None yet
Development

No branches or pull requests

3 participants