Get a sneak peek at whats next for Permanent Hazards on our April 7th Office Hours!
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

Post Reply
Forum rules
Discussion for the unofficial, community-developed addons, extensions and scripts built for the Waze Map Editor.

DO NOT START a new thread unless it is about a new idea. Keep discussion of existing tools within the main thread for that tool.

The official index of these tools is the Community Plugins, Extensions and Tools wiki page.

[Script] WME Split POI

Post by
This script Add a button to allow you to split or cut a POI into two, with copy of the features.

His usage is limited to this POI categories:
--> Natural Features - Sea/Lake/Pool - River/Stream - Forest/Grove - Canal.

1 - Create a new segment through the POI from side to side.
Attention: only 2 points of intersection with the contour of the POI.
2 - Select POI and click the button "Split POI".
3 - Check the change, delete the new segment and save.
CutPoi.jpg
 
SplitButton.jpg
 

DOWNLOAD: from GreasyFork.org.
'''Compatible with Chrome (Tampermonkey) and Firefox (Greasemonkey)'''

Update v1.7:
- Support for all subcategories "Natural Features" (Island, Sea/Lake/Pool, River/Stream, Forest/Grove, Farm, Canal, Swamp / Marsh, Dam)
 

POSTER_ID:16863068

1

Send a message
Last edited by seb-d59 on Sat Sep 17, 2016 6:02 am, edited 1 time in total.


Post by AndyLaode
is it possible to split Map Comment also? I want to duplicate map comment
AndyLaode
Posts: 808
Has thanked: 13 times
Been thanked: 242 times
Send a message
andylaode (andylaode@outlook.com)
okay, mate, see you on the road and on the map too, cheers

Post by bures
OT: And what about merge POI? It would be nice.
bures
Waze Global Champs
Waze Global Champs
Posts: 993
Has thanked: 288 times
Been thanked: 345 times
Send a message

Post by bures
bures wrote:OT: And what about merge POI? It would be nice.
Hi seb-d59. Do you've been thinking abou it?
bures
Waze Global Champs
Waze Global Champs
Posts: 993
Has thanked: 288 times
Been thanked: 345 times
Send a message

Post by drslump34
De nouveau HS ou j'ai loupé un truc ?
drslump34
PartnerCoordinator
PartnerCoordinator
Posts: 7950
Answers: 1
Has thanked: 653 times
Been thanked: 1345 times
Send a message
Global Champ / Local Champ France DROM-COM - 50,5K UR - 870,8K edits - lvl 6
Community Partners Coordinator France

CM Maroc @WazeMaroc
CM Laos / Burkina-Faso

Votre interlocuteur Sud de France @WazeGard @WazeHerault @WazeRhone

Waze 4.102.0.2 sur OnePlus 12

Post by eclectice
I am unable to use this script...it doesn't work

I was trying to cut into two segments for Sungai Gabai river with a split segment somewhere in the middle of the map view but I couldn't.

https://www.waze.com/editor/?env=row&lo ... 56.2844627
eclectice
Posts: 21
Has thanked: 1 time
Been thanked: 1 time
Send a message

Post by Frantzisko
Because there is no solution yet from @Sebiseba, I created the following fork to patch the incompatibility issues and added the Other category:
https://greasyfork.org/en/scripts/47086 ... t-poi-mod/

All credits to @Sebiseba for the effort of creating this script.

Feel free to share your feedback.
 
Frantzisko
Coordinators
Coordinators
Posts: 37
Has thanked: 5 times
Been thanked: 2 times
Send a message

Post by Gazoo4U
seb-d59 wrote:Update v1.7:
- Support for all subcategories "Natural Features" (Island, Sea/Lake/Pool, River/Stream, Forest/Grove, Farm, Canal, Swamp / Marsh, Dam)
Nice Script.

I've modified it to allow "Parking Lots" too. Many editors (*cough* Waze paid services *cough*) have added "parking lots" which actually encompass multiple real parking lots.

I'm pretty sure these changes should do the trick...

Code: Select all

--- /tmp/splitpoi.orig  2018-01-03 15:01:14.075473900 -0500
+++ /tmp/splitpoi       2018-01-03 15:11:11.577573400 -0500
@@ -235,7 +235,7 @@
                if (!attributes.geometry.hasOwnProperty("components"))
                  return;

-               if (!((attributes.categories == "NATURAL_FEATURES" ) || (attributes.categories == "ISLAND" ) || (attributes.categories == "SEA_LAKE_POOL") || (attributes.categories == "RIVER_STREAM" ) || (attributes.categories == "FOREST_GROVE") || (attributes.categories == "FARM" ) || (attributes.categories == "CANAL" ) || (attributes.categories == "SWAMP_MARSH" ) || (attributes.categories == "DAM" )))
+               if (!((attributes.categories == "NATURAL_FEATURES" ) || (attributes.categories == "ISLAND" ) || (attributes.categories == "SEA_LAKE_POOL") || (attributes.categories == "RIVER_STREAM" ) || (attributes.categories == "FOREST_GROVE") || (attributes.categories == "FARM" ) || (attributes.categories == "CANAL" ) || (attributes.categories == "SWAMP_MARSH" ) || (attributes.categories == "DAM" ) || (attributes.categories == "PARKING_LOT" )))
                  return;
                log("selectionManager",selectionManager);

@@ -254,14 +254,14 @@
         item=getId("landmark-edit-general");

         var attSection = getElementsByClassName("attributes-form side-panel-section", item);
-        var btnResidential = getElementsByClassName("btn-link toggle-residential",item);
-        var parent1 = btnResidential[0].parentNode;
+        var extProviders = getElementsByClassName("external-providers-view");
+        var parent1 = extProviders[0].parentNode;
         var parent = parent1.parentNode;
         var WMESP_Controle=document.createElement('Div');

         WMESP_Controle.id="WMESP-Controle";
-        WMESP_Controle.innerHTML+='<br><input type="button" id="_btnSplitPOI" class="action-button waze-btn waze-btn-white" value="Split POI"><br>';
-                   attSection[0].insertBefore(WMESP_Controle, parent);
+        WMESP_Controle.innerHTML+='<br><input type="button" id="_btnSplitPOI" class="action-button waze-btn waze-btn-white" value="Split POI"><br><br>';
+                   attSection[0].insertBefore(WMESP_Controle, parent.nextSibling); // nextSibling makes this effectively an "insertAfter"
         getId("_btnSplitPOI").onclick=SplitPOI;
     }

@@ -425,6 +425,7 @@
     clonePoiAttr.aliases = poi.attributes.aliases;
     clonePoiAttr.approved = poi.attributes.approved;
     clonePoiAttr.categories = poi.attributes.categories;
+    clonePoiAttr.categoryAttributes = poi.attributes.categoryAttributes;
     clonePoiAttr.description = poi.attributes.description;
     clonePoiAttr.externalProviderIDs = poi.attributes.externalProviderIDs;
     clonePoiAttr.houseNumber = poi.attributes.houseNumber;
@@ -446,33 +447,18 @@
     // copie du nom et mise à jour du nouveau poi

     var street = wazeModel.streets.objects[poi.attributes.streetID];
-    streetName = street.name;
+    var streetName = street.name;
+    var streetEmpty = street.isEmpty
     var cityID = street.cityID;
     var city = wazeModel.cities.objects[cityID];
+    var cityEmpty = city.attributes.isEmpty
     var stateID = wazeModel.cities.objects[cityID].attributes.stateID;
     var state = wazeModel.states.objects[stateID];
     var countryID = wazeModel.cities.objects[cityID].attributes.countryID;
     var country = wazeModel.countries.objects[countryID];
-
-    if (!street.isEmpty || !city.attributes.isEmpty){ // nok
-       var newAtts = { emptyStreet: true, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: true };
-      log ('Natural feature POI: no street name and city');
-      wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(poi, newAtts));
-               }
-               var street = wazeModel.streets.objects[clonePoi.attributes.streetID];
-    streetName = street.name;
-    var cityID = street.cityID;
-    var city = wazeModel.cities.objects[cityID];
-    var stateID = wazeModel.cities.objects[cityID].attributes.stateID;
-    var state = wazeModel.states.objects[stateID];
-    var countryID = wazeModel.cities.objects[cityID].attributes.countryID;
-    var country = wazeModel.countries.objects[countryID];
-
-    if (!street.isEmpty || !city.attributes.isEmpty){ // nok
-       var newAtts = { emptyStreet: true, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: true };
-      log ('Natural feature POI: no street name and city');
-      wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(clonePoi, newAtts));
-               }
+
+    var newAtts = { emptyStreet: streetEmpty, stateID: stateID, countryID: countryID, cityName: city.attributes.name, streetName: streetName, emptyCity: cityEmpty };
+    wazeModel.actionManager.add(new WazeActionUpdateFeatureAddress(clonePoi, newAtts));

     //log('wazeModel.actionManager = ',wazeModel.actionManager);
Gazoo4U
Posts: 50
Has thanked: 21 times
Been thanked: 33 times
Send a message

Post by Horizon911
Thanks for a very practical script! A bit tricky to find it but it does its the great job. It's a shame the WME does not have this capability by default.
But I noticed one small issue:
Sometimes while splitting POIs (especially if working in low zoom levels like 0, 1, 2), WME seems to mistakenly detect an overlap (or some other issue, perhaps) and creates PUR. (Disregarding POI's lock level.) I avoid that by renaming the new POI prior an attempt to save them. (I thought that unique name could be automatically assigned by the script... e.g. by adding some universal sufix, like "(split)" or "(part)" or st. like that.)

Thanks
Horizon911
Posts: 513
Has thanked: 279 times
Been thanked: 26 times
Send a message

Post by Horizon911
Hello again,
I understood that button's visibility is restricted to certain POI categories only. If it's necessary, then I've got some feature requests, if possible:
1. It would be good to have supported "Park" category.
2. It would be helping to have better handled situations, when POI has got 2 categories at the same time. For example: I've got a POI, which is "Park" as well as "Forest/Grove". Currently, the script hides Split POI button, unless user removes all 'unsupported' categories.
Horizon911
Posts: 513
Has thanked: 279 times
Been thanked: 26 times
Send a message