Giter Club home page Giter Club logo

Comments (6)

kenguest avatar kenguest commented on May 24, 2024

I think you unearthed a bug! I'll try to look into this later on today.

from services_openstreetmap.

kenguest avatar kenguest commented on May 24, 2024

@erkinsergey, would you mind confirming this is fixed now please?

from services_openstreetmap.

erkinsergey avatar erkinsergey commented on May 24, 2024

During the creation of this issue, I have slightly changed the task. Now I do not need to delete tags, I just need to change the values โ€‹โ€‹of existing tags.
Therefore, the existing working functionality suits me perfectly and I can close the issue.

However, I tried to test the work of removeTags and got an error. My code:

$config = [
    'adapter'         => 'HTTP_Request2_Adapter_Curl',
    'api_version'     => '0.6',
    'password'        => 'password',
    'server'          => 'https://my_local_osm_server',
    'User-Agent'      => 'Services_OpenStreetMap',
    'user'            => 'user',
    'ssl_verify_peer' => FALSE,
    'ssl_verify_host' => FALSE,
  ];

  $osm = new Services_OpenStreetMap($config);
  $node = $osm->getNode(147075);
  if ($node) {
          $changeset = $osm->createChangeset();

         $changeset->begin("Test change tags via API");
        // the node 147075 have tags 'some' and 'tag2'
         $node->removeTags(['some', 'tag2']);

         $changeset->add($node);

          $changeset->commit();
      }
     print_r($node->getTags());

Result - empty changeset on OSM-server (with field num_changes = 0) and catched exception:

message: Error posting changeset,
file: Services/OpenStreetMap/Changeset.php
line: 353,
code: 400

In this case, xml for changes looks like this:

<osmChange version='0.6' generator='Services_OpenStreetMap'><><node id="147075" changeset="14140" timestamp="2018-09-12T06:35:39Z" version="4" visible="true" user="user" uid="3" lat="47.1728333" lon="38.8641021" action="">
    <tag k="caption" v="My Caption"/>
    <tag k="power" v="pole"/>
    <tag k="some" v="new_val"/>
    <tag k="state" v="actual"/>
    <tag k="tag2" v="tag2_val"/>
  </node></>
</osmChange>

Perhaps there really is a mistake.
As I understand it, instead of empty tags, the tag should be 'modified'.

from services_openstreetmap.

dktue avatar dktue commented on May 24, 2024

Apparently, this is still not working, I'm having the same issue. When removing a tag, nothing happens on the OSM-side.

from services_openstreetmap.

erkinsergey avatar erkinsergey commented on May 24, 2024

You need to create a new Issue. I closed this for the reason described above.

from services_openstreetmap.

dktue avatar dktue commented on May 24, 2024

I created #42

from services_openstreetmap.

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.