Code Monkey home page Code Monkey logo

Comments (8)

bdon avatar bdon commented on May 25, 2024 1

Okay, let me know what you find out; Onramp exercises more code paths than my own production system so I'm keen to get to the bottom of any missing data, etc.

from osmexpress.

bdon avatar bdon commented on May 25, 2024

Hi,

  1. There are two tables, one called nodes and one called locations. Lat,Long,and Version are stored in locations, and there will only be a corresponding entry in nodes for the ID if there are tags. So if a node has no tags, it will only appear in locations. This may not be relevant in this situation.
  2. Can you provide the node ID? If your database is replicating the public stream, it would be helpful for me to try to reproduce this. Maybe it's just a matter of the python code missing logic to add that information to the diff.

from osmexpress.

bdon avatar bdon commented on May 25, 2024

@jpolchlo looking over this a bit more, it may just be as simple as https://github.com/azavea/onramp/blob/master/app/onramp/diff.py#L101-L102 checking if o exists first, e.g.:

o = nodes.get(elem_id)
if o:
  it = iter(o.tags)
  for t in it:
    tag = ET.SubElement(elem, "tag")
    tag.set("k", t)
    tag.set("v", next(it))

The majority of nodes (~70%) have no tags, so nd will be none. in the context of onramp, the empty tag field should be correct behavior. but it would need to be modified as above to include tags for nodes that are tagged.

from osmexpress.

jpolchlo avatar jpolchlo commented on May 25, 2024

Sadly, this is a private deployment, and I cannot share the contents, but I'll give you a redacted form of the diff:

{
    "type":"FeatureCollection",
    "id":"delete",
    "features":[
        {
            "type":"Feature",
            "id":"old",
            "properties":{
                "changeset":"2345678",
                "id":"1234567890",
                "tags":{
                    "building":"greenhouse",
                    "condition":"intact",
                    ...
                },
                "timestamp":"...",
                "type":"node",
                "uid":"###",
                "user":"...",
                "version":"1",
                "visible":true
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    ...
                ]
            }
        },
        {
            "type":"Feature",
            "id":"new",
            "properties":{
                "changeset":"3456789",
                "id":"1234567890",
                "tags":{
                    "building":"greenhouse",
                    "condition":"intact",
                    ...
                },
                "timestamp":"...",
                "type":"node",
                "uid":"###",
                "user":"...",
                "version":"2",
                "visible":false,
                "augmentedDiff":#####
            },
            "geometry":{
                "type":"Point",
                "coordinates":[
                    ...
                ]
            }
        }
    ]
}

That's from Overpass. The thing to notice is that the node appears here with non-empty tags. The Onramp-generated augmented diff record has no tags. If I attempt to query for the node ID (1234567890 in the above) using osmx, I can find the matching location, but I get a None response from the Nodes.get query, which is confusing.

Am I thinking about this wrong? Shouldn't the tags in Overpass be represented in the osmx database?

from osmexpress.

jpolchlo avatar jpolchlo commented on May 25, 2024

Oh, rats. It occurred to me that because the entity I'm querying was deleted, the tags would no longer be present in the OSMX DB at the time I'm querying it. The solution you posted should work.

image

Will re-open if I'm wrong.

from osmexpress.

bdon avatar bdon commented on May 25, 2024

That definitely seems odd. In the OSMX database, the locations table has a 3rd number which is the version number. Can you compare that to overpass?

from osmexpress.

bdon avatar bdon commented on May 25, 2024

Oh, rats. It occurred to me that because the entity I'm querying was deleted, the tags would no longer be present in the OSMX DB at the time I'm querying it. The solution you posted should work.

image

Will re-open if I'm wrong.

I thought of that too, but if that was the case I believe the location entry should have been deleted, because OSMX doesn't store historical data (overpass does)

from osmexpress.

jpolchlo avatar jpolchlo commented on May 25, 2024

Right. Got my memory mixed up. The locations were from a different example. Indeed the locations for the deleted node are deleted as well.

from osmexpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.