Code Monkey home page Code Monkey logo

realdevicemap-tools's Introduction

RealDeviceMap-tools

RealDeviceMap-tools

Tools for managing RealDeviceMap data

rdm-tools.php

Changes

  • Now you can report on all nests at once!
  • You don't have to have spawns/stops visible on map to perform reporting anymore.
  • Revised optimization function - same super simple algorithm, might be better performing though
  • Changes to data storage, functions no longer loop through map objects, coordinates for gyms/stops/spawns are stored separately. Should help with performance

Features

  • View/hide known gyms, stops, and spawnpoints
  • Optionally show only unknown gyms/stops
  • Nest polygon import from OSM data, set to last datetime of Niantic OSM sync
    • [date:"2018-04-09T01:32:00Z"]
    • way["leisure"="park"]
    • way["leisure"="recreation_ground"]
    • way["landuse"="recreation_ground"]
  • CSV and GeoJSON polygon import
  • GeoJSON polygon export
  • Coordinate generation - blanket fill polygons with route points
  • Coordinate optimization - fill polygons with route points optimized for existing known gyms/stops/spawnpoints
  • Instance import - view your RDM instances and add/remove route points, then reexport and upload to RDM

Installation

Simply upload rdm-tools.php to your favorite webserver, point the database variables to your RDM DB's IP, and configure your username/password.

Usage

The map has a variety of control buttons for performing different functions:

Map Settings Settings

  • Nest Migration Date - select the last nest migration.
  • Optimization Attempts - number of passes to attempt to optimize coordinates during optimization.
  • Circle Size - View distance radius (in meters) to route for.
  • Generate all nests - Get a report of spawns for all nests in current map bounds. See below.

Map mode

  • Map Mode - Routing Enables full functionality including polygon and routing functions.
  • Map Mode - Viewing For viewing points of interest and spawnpoints only. Enables the option to filter unknown points of interest.

View mode

  • View Mode - Gyms Enables/disables viewing gyms as red dots on the map.
  • View Mode - Pokestops Enables/disables viewing pokestops as green dots on the map.
  • View Mode - Spawnpoints Enables/disables viewing spawnpoints as blue dots on the map.

Routing and Drawing

  • Draw Polygon Enables drawing of polygons on the map.
  • Manual route placement Enables/disables manual placement of route points. Click on the map to drop a route point in the routing layer based on view radius setting.
  • Import Nests Pulls nest data from OSM and places polygons in the current map bounds covering all parks.
  • Import Polygon Import CSV or GeoJSON polygon data. GeoJSON can contain multiple polygons, each one will be placed individually.
  • Import Instance Imports an instance from your RDM DB and places the route points in the routing layer based on view radius setting.
  • Clear Routing Layer Clears the current route from the map, leaving polygons behind
  • Clear All Layers Clears all route points and polygons from map.
  • Generate Route Generates a blanket route over all polygons on the map.
  • Optimize Route Takes all visible points - gyms, stops, and spawns - and optimizes a route between them based on view radius (circle size).
  • Get Output Opens a textbox to generate lat,lon points for all routing layer coordinates, to be saved as an instance in RDM.

Polygon options

Polygon Options

Clicking on any polygon will allow you to generate a spawn report, remove it from the map, or export as GeoJSON.

To generate a spawn report, keep in mind the Nest Migration Date setting. The query generated for your database will only grab spawn data from that point forward. If you are just looking to get data for your area and not specifically reporting on a nest, set the date accordingly before generating your report. Once generated, a modal window will open showing a table of all the spawn counts for that polygon.

Example spawn report

Example spawn report for a local nest.

New feature - generate a spawn report for all nests

In the settings menu, a new button is available to create a report for all nests in your current map bounds. Make sure you import nest polygons first!

Example spawn report

Example multi-nest report

Route options

Route Options

After a route is generated, you can click on any point of the route to remove it from the map.

Example outputs

Example spawn route

Example route showing a blanket route of 75m circles covering a town for finding new spawn points.

Example gym route

Example route showing the same polygon covered with 500m circles for finding new raids and stops.

Example optimized gym route

Example optimization covering gyms in a polygon

Example nest route

Example optimization covering all nests in map bounds, for finding new spawnpoints in nests

Example optimized nest route

Example optimization covering known spawnpoints in multiple nests. Note that you can remove overlapping circles by clicking on them and choosing delete - the optimization routine still needs some work.

realdevicemap-tools's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

realdevicemap-tools's Issues

Limit nest report to top 10 spawns

currently nest report shows everything which is a bit longer then needed. Showing top 10 would likely be sufficient especially in all nest report.

Wrong S2 cell level for gyms.

You have it set for L14, and it should be L15. (... and the default visibility should be a 500m radius when using S2 cells. )

Nice work!

Spawn report does not work

Found the issue here:
$sql_spawn = "SELECT pokemon_id, COUNT(pokemon_id) as count FROM rdmdb.pokemon WHERE " . $points_string . " AND first_seen_timestamp >= ? GROUP BY pokemon_id ORDER BY count DESC" . $limit;

Query defines the database name assuming everyone uses rdmdb. This needs removing to read:
$sql_spawn = "SELECT pokemon_id, COUNT(pokemon_id) as count FROM pokemon WHERE " . $points_string . " AND first_seen_timestamp >= ? GROUP BY pokemon_id ORDER BY count DESC" . $limit;

Tokyo coordinates

Tokyo coordinates were coming out as -220 for the lon value should be 139ish.

Cannot read property 'lat' of null TypeError: Cannot read property 'lat' of null

Hi,

this tool worked like charme till today, didn't change a bit, but today the page keeped blank, consol output:

jquery.min.js:2 jQuery.Deferred exception: Cannot read property 'lat' of null TypeError: Cannot read property 'lat' of null at Object.project (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:24364) at Object.latLngToPoint (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:23003) at e.project (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:39368) at e._getNewPixelOrigin (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:45470) at e._move (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:42126) at e._resetView (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:41836) at e.setView (https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js:5:30590) at initMap (http://192.168.178.23:8080/rdm-tools.php:261:45) at HTMLDocument.<anonymous> (http://192.168.178.23:8080/rdm-tools.php:124:3) at l (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29375) undefined w.Deferred.exceptionHook @ jquery.min.js:2 jquery.min.js:2 Uncaught TypeError: Cannot read property 'lat' of null at Object.project (leaflet.js:5) at Object.latLngToPoint (leaflet.js:5) at e.project (leaflet.js:5) at e._getNewPixelOrigin (leaflet.js:5) at e._move (leaflet.js:5) at e._resetView (leaflet.js:5) at e.setView (leaflet.js:5) at initMap (rdm-tools.php:261) at HTMLDocument.<anonymous> (rdm-tools.php:124) at l (jquery.min.js:2) 13leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._fireDOMEvent (leaflet.js:5) at e._handleDOMEvent (leaflet.js:5) at HTMLDivElement.r (leaflet.js:5) leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e.getCenter (leaflet.js:5) at e.<anonymous> (leaflet.js:5) at e.fire (leaflet.js:5) leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._fireDOMEvent (leaflet.js:5) at e._handleDOMEvent (leaflet.js:5) at HTMLDivElement.r (leaflet.js:5) leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e.getCenter (leaflet.js:5) at e.<anonymous> (leaflet.js:5) at e.fire (leaflet.js:5) 4leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._fireDOMEvent (leaflet.js:5) at e._handleDOMEvent (leaflet.js:5) at HTMLDivElement.r (leaflet.js:5) leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._touchEvent (leaflet.draw.js:9) at e._onTouchStart (leaflet.draw.js:9) at r (leaflet.js:5) at j (leaflet.js:5) at leaflet.js:5 15leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._fireDOMEvent (leaflet.js:5) at e._handleDOMEvent (leaflet.js:5) at HTMLDivElement.r (leaflet.js:5) leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e.getCenter (leaflet.js:5) at e.<anonymous> (leaflet.js:5) at e.fire (leaflet.js:5) _add @ leaflet.js:5 add @ leaflet.js:5 layerPointToLatLng @ leaflet.js:5 getCenter @ leaflet.js:5 (anonymous) @ leaflet.js:5 fire @ leaflet.js:5 65leaflet.js:5 Uncaught TypeError: Cannot read property 'x' of undefined at x._add (leaflet.js:5) at x.add (leaflet.js:5) at e.layerPointToLatLng (leaflet.js:5) at e._fireDOMEvent (leaflet.js:5) at e._handleDOMEvent (leaflet.js:5) at HTMLDivElement.r (leaflet.js:5) _add @ leaflet.js:5 add @ leaflet.js:5 layerPointToLatLng @ leaflet.js:5 _fireDOMEvent @ leaflet.js:5 _handleDOMEvent @ leaflet.js:5 r @ leaflet.js:5

Allow import of geofenced instances

with new rdm features being geofence dependent, being able to import them would be handy. currently trying to import one will crash the tool

Allow export multiple geojsons

Whilst the nest import is very helpful it is not 100% inclusive and in some areas too many areas are imported, manual adjustment and mini nest removal is required.

Once adjustments are made it would be handy to export all the areas at once for future import and spawn reporting

many parks show "undefined"

This is most likely an OSM issue for my area however as a test I added a name to a park (name label) but removing from tool and hitting import nest from OSM doesn't appear to change anything.

Perhaps there is a specific field needed or perhaps the tool caches some info?

PHP PDO DB connection error

Got error 'PHP message: PHP Warning: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]

Newer version mysql not supported sha2 passwords.
It can not connect to db.

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.