[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

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 Olestas » Tue Jan 26, 2016 12:11 pm

Sorry, I missed the line about poi category :D
[ img ][ img ][ img ][ img ]

GC: Latvia
Coordinator: Latvia
Country manager (Full coverage): Latvia/Lithuania/Belarus/Russia/Ukraine
Olestas
Coordinators
Coordinators
 
Posts: 6254
Joined: Wed Mar 09, 2011 7:08 pm
Location: Latvia
Has thanked: 3389 times
Been thanked: 2328 times

Re: [Script] WME Split POI

Postby tbk0 » Wed Mar 02, 2016 12:53 pm

Great script and very useful.
tbk0
Area Manager
Area Manager
 
Posts: 97
Joined: Mon May 12, 2014 2:00 pm
Has thanked: 0 time
Been thanked: 39 times

Re: [Script] WME Split POI

Postby seb-d59 » Sat Sep 17, 2016 6:12 am

Update v1.7:
- Support for all subcategories "Natural Features" (Island, Sea/Lake/Pool, River/Stream, Forest/Grove, Farm, Canal, Swamp / Marsh, Dam)
seb-d59
Waze Local Champs
Waze Local Champs
 
Posts: 1769
Joined: Fri Jan 03, 2014 8:01 am
Location: Croix (59) - Mentoring Nord Pas-de-Calais
Has thanked: 488 times
Been thanked: 572 times

Re: [Script] WME Split POI

Postby whathappened15 » Thu May 11, 2017 8:37 pm

Would you consider adding support for Parking Lot Areas?
whathappened15
Tennessee State Manager

[ img ][ img ][ img ][ img ][ img ][ img ]
whathappened15
State Manager
State Manager
 
Posts: 63
Joined: Tue Jul 26, 2016 2:05 pm
Has thanked: 60 times
Been thanked: 37 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: 936
Joined: Mon Jun 27, 2011 1:38 pm
Location: Holešov
Has thanked: 588 times
Been thanked: 418 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
Country Manager
Country Manager
 
Posts: 2313
Joined: Wed Jun 17, 2015 10:05 pm
Has thanked: 428 times
Been thanked: 949 times

Previous

Return to Addons, Extensions, and Scripts

Who is online

Users browsing this forum: Mythdraug, RichardPyne