polygons

Finding polygons within an undirected Graph

爷,独闯天下 提交于 2019-12-19 08:04:50
问题 Please see Image: http://i.stack.imgur.com/NPUmR.jpg I have an undirected graph which contains one or more connected sub graphs. The graph is defined by a set of ordered pairs of connected vertices. There may be upto 300 vertices. The graph is planar. I need to identify polygons as shown in the Image. Each of the coloured areas in a separate polygon. A rough heuristic could be that polygons are "enclosed regions" between closed edge loops (cycles) in the graph. It's been suggested in similar

Voronoi diagram polygons enclosed in geographic borders

自古美人都是妖i 提交于 2019-12-17 22:50:57
问题 I am trying to create Voronoi polygons (aka Dirichlet tessellations or Thiessen polygons) within a fixed geographic region for a set of points. However, I am having trouble finding a method in R that will bound the polygons within the map borders. My main goal is to get accurate area calculations (not simply to produce a visual plot). For example, the following visually communicates what I'm trying to achieve: library(maps) library(deldir) data(countyMapEnv) counties <- map('county', c(

google maps API v3 - how to draw dynamic polygons/polylines?

蓝咒 提交于 2019-12-17 17:29:19
问题 I have 4 days of experience with Google Maps Javascript API and i find their documentation and information sharing confusing at best. Does anyone have experience or knowledge on how to draw polygons/polylines on a google map (using Javascript API V3) similar to this example? (which i found on this blogPost from 2008) So far as my research can tell me the example uses the Javascript API V2 directly or uses the GeometryControl utility library from V2 (which can be found here for reference). I

google maps polygons - overlay

旧街凉风 提交于 2019-12-14 00:33:23
问题 I am attempting to implement a "negative" overlay on my google maps, similar to the effect that you get at estately.com. Basically, I have successfully drawn up mapping polygons from the KML data I've gathered. When there are multiple paths, they draw up just fine. So, modeling the example I have, first I create a set of polyLines around my area from polygonCoords (which is an array of arrays of LatLng objects): for (var d = 0 ; d < polygonCoords.length ; d++) { var b = new google.maps

Issue with program output

孤街醉人 提交于 2019-12-13 23:09:38
问题 Below is my program that determines the perimeter and area of a polygon given a certain amount of (x,y) coordinates but I seem to be getting the wrong output and I can't see why. The input is: 3 12867 1.0 2.0 1.0 5.0 4.0 5.0 5 15643 1.0 2.0 4.0 5.0 7.8 3.5 5.0 0.4 1.0 0.4 With the first entry being the number of points (points) and the second entry being the polygon ID, anything after that is a set of coordinates. #include <stdio.h> #include <stdlib.h> #include <math.h> #define MAX_PTS 100

Rotate 2D polygon without changing its position

微笑、不失礼 提交于 2019-12-12 21:04:03
问题 I've got this code: class Vector2D(object): def __init__(self, x=0.0, y=0.0): self.x, self.y = x, y def rotate(self, angle): angle = math.radians(angle) sin = math.sin(angle) cos = math.cos(angle) x = self.x y = self.y self.x = x * cos - y * sin self.y = x * sin + y * cos def __repr__(self): return '<Vector2D x={0}, y={1}>'.format(self.x, self.y) class Polygon(object): def __init__(self, points): self.points = [Vector2D(*point) for point in points] def rotate(self, angle): for point in self

Is there a way to fade out a V3 google.maps.Polygon?

前提是你 提交于 2019-12-12 08:13:42
问题 Is there a way to fade out a V3 google.maps.Polygon? Instead of just hiding / removing a standard Google Maps V3 polygon I want to fade it out. Is this possible? Are there any plugins out there? 回答1: The following is a solution I created to address the uniform fade out of stroke and fill and I made it easily reusable by making it a function. seconds is how long it will take the fade out to occur and callback so you could do perform another action once it completes. In my project my callback

Changing Leaflet map according to input without redrawing (multiple polygons)

老子叫甜甜 提交于 2019-12-12 07:17:11
问题 cannot fix my problem for MULTIPLE filters/polygons. Currently my code works, but very slow, I do not use observe(), reactive(), and LeafletProxy() , because I stumbled. I obviously checked this answer Changing Leaflet map according to input without redrawing and this one Making Shiny UI Adjustments Without Redrawing Leaflet Maps and leaflet tutorial Using Leaflet with Shiny In my case I have four filters and do not quite understand how to combine them together and make the map fast. My

Google Maps API V3 - Custom infobox for multiple polygons

☆樱花仙子☆ 提交于 2019-12-12 02:21:20
问题 This is my first time working with the Google Maps API. I have a styled map with multiple polygons that each need their own infobox. The infoboxes need to be styled. My problem is that I can't get the infoboxes to work at all. I've been looking for a solution for days now, I've even tried this http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/examples/infobox-basic.html I must obviously be doing something wrong. Here's my code: http://pastebin.com/M23PPXpn 回答1: I

MySQL 5.7.19 Invalid GIS data provided to function st_geometryfromtext

☆樱花仙子☆ 提交于 2019-12-11 15:14:34
问题 So I am new at ST_ functions in MySql and I think that I am missing something. I am trying to save a POLYGON in MySql, the problem is that when using the function ST_GEOMFROMTEXT and giving the coordinates of the POLYGON taken from Google Maps Javascript API it returns the error: Invalid GIS data provided to function st_geometryfromtext . I've read a lot in Internet but everywhere it mostly says that it's a version problem, the thing here is the I have the most recent one right now (5.7.19)