[Script] WME Split POI

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.

Moderators: Unholy, bextein, Glodenox, JustinS83

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.

Re: [Script] WME Split POI

Postby AndyLaode » Thu Apr 09, 2020 9:53 am

is it possible to split Map Comment also? I want to duplicate map comment
andylaode (andylaode@outlook.com)
okay, mate, see you on the road and on the map too, cheers
AndyLaode
Beta tester
Beta tester
 
Posts: 808
Joined: Mon May 19, 2014 9:04 am
Location: on my way from my house to insanity
Has thanked: 13 times
Been thanked: 260 times

Re: [Script] WME Split POI

Postby bures » Fri Nov 06, 2015 12:16 pm

OT: And what about merge POI? It would be nice.
[ img ][ img ]
Jirka Bureš
bures
Waze Global Champs
Waze Global Champs
 
Posts: 992
Joined: Mon Jun 27, 2011 1:38 pm
Location: Holešov
Has thanked: 661 times
Been thanked: 437 times

Re: [Script] WME Split POI

Postby bures » Fri Jul 14, 2017 7:27 am

bures wrote:OT: And what about merge POI? It would be nice.

Hi seb-d59. Do you've been thinking abou it?
[ img ][ img ]
Jirka Bureš
bures
Waze Global Champs
Waze Global Champs
 
Posts: 992
Joined: Mon Jun 27, 2011 1:38 pm
Location: Holešov
Has thanked: 661 times
Been thanked: 437 times

Re: [Script] WME Split POI

Postby eclectice » Tue Dec 01, 2015 8:19 am

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
Localizers
Localizers
 
Posts: 21
Joined: Tue Nov 13, 2012 4:41 am
Has thanked: 1 time
Been thanked: 3 times

Re: [Script] WME Split POI

Postby Gazoo4U » Wed Jan 03, 2018 8:33 pm

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);
Kelley Cook a.k.a. Gazoo4U
[ img ]
Gazoo4U
 
Posts: 50
Joined: Sun Apr 13, 2014 1:05 am
Has thanked: 23 times
Been thanked: 33 times

Re: [Script] WME Split POI

Postby jm6087 » Tue Jul 31, 2018 9:23 pm

Can you add Parking Lots to the script? They have to be split fairly often and after each update I have to edit the script to make it work.

Thanks
jm6087
US Waze Champs
US Waze Champs
 
Posts: 4545
Joined: Wed Jun 17, 2015 10:05 pm
Location: Lone Star State, Hook 'em Horns
Has thanked: 776 times
Been thanked: 1903 times

Re: [Script] WME Split POI

Postby MaximKiev » Wed Apr 08, 2020 9:57 am

Hello,

Thank you for the script. Unfortunately the button doesn't appear in POI. Mac, Chrome, Tampermonkey, category: Sea/Lake/Pool.

Снимок экрана 2020-04-08 в 10.53.35.png
(208.07 KiB) Downloaded 75 times
AM Rabat-Fès-Taza-Oujda
AM Ярославская область

[ img ]
MaximKiev
Waze Local Champs
Waze Local Champs
 
Posts: 798
Joined: Mon Sep 29, 2014 12:04 pm
Location: Maroc – Россия
Has thanked: 128 times
Been thanked: 45 times

Re: [Script] WME Split POI

Postby moweez » Sun Aug 02, 2020 2:52 pm

MaximKiev wrote:Hello,

Thank you for the script. Unfortunately the button doesn't appear in POI. Mac, Chrome, Tampermonkey, category: Sea/Lake/Pool.

Снимок экрана 2020-04-08 в 10.53.35.png


I encountered the same, but disabling all other scripts helped... So it seems to be an interaction. Don't know yet which script interferes.
moweez
Global Champ Mentor
Global Champ Mentor
 
Posts: 1243
Joined: Wed Dec 14, 2011 11:22 pm
Has thanked: 851 times
Been thanked: 740 times

Re: [Script] WME Split POI

Postby Olestas » Fri Nov 06, 2015 12:13 pm

Could be useful. Thanks.
[ img ][ img ][ img ][ img ]
[size=100]
GC: Latvia
Coordinator: Latvia
Olestas
Coordinators
Coordinators
 
Posts: 6469
Joined: Wed Mar 09, 2011 7:08 pm
Location: Latvia
Has thanked: 3657 times
Been thanked: 2401 times

Re: [Script] WME Split POI

Postby Olestas » Thu Jan 21, 2016 8:07 am

Hmm.. does not seem to work.
[ img ][ img ][ img ][ img ]
[size=100]
GC: Latvia
Coordinator: Latvia
Olestas
Coordinators
Coordinators
 
Posts: 6469
Joined: Wed Mar 09, 2011 7:08 pm
Location: Latvia
Has thanked: 3657 times
Been thanked: 2401 times

Next

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: Google [Bot], Mythdraug, RichardPyne