IE-670 / spring2024

0 stars 0 forks source link

Neighborhood Bounding Regions #1

Open cmurray3 opened 8 months ago

cmurray3 commented 8 months ago

Please reply to this message, clearly indicating

  1. The neighborhood, and
  2. Whether you are providing the inner or outer boundary.
adamdeho commented 8 months ago

NOTE: the code for both the outer and inner boundaries for Allentown are included below.

Allentown outer boundary

# Bounding Region
# Allentown, Expanded Boundary (for bus stop filtering)
myBoundingRegion = [[42.894529142546226, -78.87121868094256], [42.89534658024724, -78.87662601431657], [42.89462346283398, -78.8768620487099], [42.89490642283158, -78.87894344290545], [42.895645256704384, -78.8796730037575], [42.89583389372145, -78.87963008841326], [42.89621116602448, -78.87978029211808], [42.8971543366839, -78.88106775244525], [42.89701286200464, -78.88158273657609], [42.89768879365408, -78.88190460165788], [42.89836471789417, -78.88353538473895], [42.89878913165346, -78.88398599585344], [42.89899347797716, -78.88353538473895], [42.89922926135532, -78.88377141913226], [42.89905635363283, -78.88426494559101], [42.8997951377842, -78.8847370143776], [42.89995232475948, -78.88460826834492], [42.900062355403726, -78.88467264136125], [42.900188104471, -78.8845868106728], [42.90065966118917, -78.88508033713151], [42.901068340760965, -78.88443660696795], [42.90182281900747, -78.88503742178727], [42.90199571897192, -78.88469409903337], [42.902196911095416, -78.88481211590262], [42.90280205517785, -78.8852949135253], [42.90315885158458, -78.88437223395158], [42.903001672784114, -78.88349246939471], [42.903064544352375, -78.88224792441179], [42.903064544352375, -78.88108921011737], [42.903347465616186, -78.88063859900286], [42.90328459433643, -78.87971591910176], [42.90304882646634, -78.87973737677385], [42.903064544352375, -78.879222392643], [42.902734467903635, -78.87917947729876], [42.902718749933435, -78.87881469687274], [42.903064544352375, -78.87847137411883], [42.90308026223444, -78.87810659369279], [42.902844493582904, -78.87793493231585], [42.902734467903635, -78.87761306723408], [42.90279733974443, -78.87660455664445], [42.90309598011248, -78.87666892966081], [42.903190287296574, -78.87606811484149], [42.90347320798334, -78.87587499579243], [42.90342605462571, -78.87529563864518], [42.90297023697592, -78.8748664852028], [42.90297023697592, -78.87445878943255], [42.902561570010924, -78.87430858572772], [42.9024829798994, -78.87332153281024], [42.902828775640764, -78.87325715979388], [42.90275018586985, -78.87233447989276], [42.90312741585653, -78.87224864920428], [42.90265587801252, -78.86851501425555]]

# Text Annotations: 
annotDict = { 0: {'anchorPoint': [42.901181513278416, -78.8793468475342], 'text': 'Allentown (expanded)', 'fontSize': 39, 'fontColor': 'red'}}
for i in annotDict: 
    myMap = vrv.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 

And here is the code for the inner boundary:

# Bounding Region: 
myBoundingRegion = [[42.89456687046275, -78.8716049190407], [42.89535286797169, -78.87689423521807], [42.8946533306791, -78.87711954077533], [42.89490642283158, -78.87894344290545], [42.895645256704384, -78.8796730037575], [42.89607597695198, -78.87963223431144], [42.8963432106893, -78.8796429631475], [42.897270659969976, -78.88102054530465], [42.89710560645731, -78.8813703057531], [42.897357116635405, -78.8816986085294], [42.89800946575658, -78.88317918790564], [42.89844960102364, -78.88383579214862], [42.89893688997616, -78.88321781145352], [42.89936129979715, -78.88362550722377], [42.89906264133879, -78.88426923738736], [42.8997951377842, -78.8847370143776], [42.89995232475948, -78.88460826834492], [42.900062355403726, -78.88467264136125], [42.900188104471, -78.8845868106728], [42.90052448186944, -78.88456535234583], [42.90087028859548, -78.88482284441125], [42.901137501555354, -78.88447952165734], [42.90173794076159, -78.88480997033186], [42.902036586261325, -78.88444518990583], [42.902633872921, -78.88493871636457], [42.9029953857197, -78.88427352852888], [42.903001672784114, -78.88349246939471], [42.90335689639854, -78.88257837243147], [42.903064544352375, -78.88108921011737], [42.903347465616186, -78.88063859900286], [42.90328459433643, -78.87971591910176], [42.90304882646634, -78.87973737677385], [42.903064544352375, -78.879222392643], [42.902734467903635, -78.87917947729876], [42.902718749933435, -78.87881469687274], [42.903064544352375, -78.87847137411883], [42.90308026223444, -78.87810659369279], [42.902844493582904, -78.87793493231585], [42.902734467903635, -78.87761306723408], [42.90279733974443, -78.87660455664445], [42.902954519545496, -78.87629985809328], [42.90303310905594, -78.87591361999513], [42.90347320798334, -78.87587499579243], [42.90348892624086, -78.87539863586427], [42.903001673263795, -78.87539863586427], [42.90298595536171, -78.87496948242189], [42.90227864562029, -78.87492656707765], [42.902310081781096, -78.873188495636], [42.902671596478456, -78.87316703796388], [42.902671596478456, -78.87213706970216], [42.90306454483205, -78.87202978134157], [42.9026558784922, -78.86898279190065]]

# Text Annotations: 
annotDict = { 0: {'anchorPoint': [42.901181513278416, -78.8793468475342], 'text': 'Allentown (inner)', 'fontSize': 39, 'fontColor': 'red'}}
for i in annotDict: 
    myMap = vrv.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 
krysc0 commented 8 months ago
# Inner bounding Region (actual neighborhood)
# Masten Park
myBoundingRegion = \
[[42.90461229380348, -78.86817927485322],
[42.90456123946584, -78.86789488393428], 
[42.90444342160226, -78.86758366368338],
[42.90429286414895, -78.86725525521409],
[42.904178973055295, -78.8670245229591],
[42.90406822353519, -78.86666715638816],
[42.90401324145384, -78.86640959480121],
[42.903981823099606, -78.86601788655435],
[42.903964293303915, -78.86536756086214],
[42.90391874745096, -78.85976132044328],
[42.90384334321043, -78.85398657529076],
[42.905615503596835, -78.85395761606826],
[42.907442405921714, -78.8539608354571],
[42.90938497318183, -78.85397641309311],
[42.9111243848365, -78.85398502264303],
[42.91305487832154, -78.85398348915156],
[42.91496611643982, -78.85399246467212],
[42.91525636416974, -78.85502851251687],
[42.91528593321358, -78.85858585244014],
[42.915309090452304, -78.86322448148894],
[42.91533111091791, -78.86442752907739],
[42.915138708579505, -78.86456167573726],
[42.91388611540541, -78.8650553354456], 
[42.91168007586089, -78.86578938590297],
[42.90995521693251, -78.86639327994719], 
[42.907956873744745, -78.86706711386947],
[42.90590817709726, -78.86778482774737]]

# Text Annotations: 
annotDict = { 0: {'anchorPoint': [42.911015105108476, -78.86], 'text': 'Masten Park', 'fontSize': 14, 'fontColor': 'red'}}
for i in annotDict: 
    myMap = vrv.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 
yusufihsantokel commented 8 months ago
# Masten Park, Outer Boundary (for bus stop filtering): 
myBoundingRegion = [[42.91548727980769, -78.86480712943013], 
[42.91548727980769, -78.85485076956685], 
[42.91498453395222, -78.85369205527242], 
[42.903670602057765, -78.85379934363301], 
[42.90372151126768, -78.86625337574516], 
[42.90455433403106, -78.86843776650495]]

# annotation
annotDict = { 0: {'anchorPoint': [42.91, -78.86], 'text': 'Masten Park', 'fontSize': 18, 'fontColor': 'red'}}
lohithub commented 8 months ago
#Allentown Inner 3rd Row
# Bounding Region: 
myBoundingRegion = [[42.899253208691206, -78.86986438641259], [42.89308773116517, -78.87170974621482], [42.89434604194931, -78.87831870922751], [42.89176647721021, -78.88346855053612], [42.90595274806196, -78.89668647656151], [42.913343415852836, -78.88231841721505], [42.91557616611675, -78.88214675583811], [42.915418932830455, -78.86910049118966], [42.902398624922604, -78.87304870285959], [42.90214699768282, -78.86871425309151], [42.899127390700926, -78.86987296738594]]

# Nodes: 
# [There are no nodes defined] 

# Arcs/Routes: 
# [There are no arcs defined] 

# Text Annotations: 
annotDict = { 0: {'anchorPoint': [42.90544270046536, -78.8828867276186], 'text': 'AllenTown Buffalo', 'fontSize': 10, 'fontColor': 'brown'}}
myMap = vz.createLeaflet(boundingRegion=myBoundingRegion) 
for i in annotDict: 
    myMap = vz.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 
# Bounding Region: 
myBoundingRegion2 = [[42.899042124228245, -78.86357116803994], [42.893996528436645, -78.86458396911623], [42.89434604194931, -78.87831870922751], [42.89176647721021, -78.88346855053612], [42.90910691964182, -78.8992767344462], [42.91520790179825, -78.8886337290751], [42.91557616611675, -78.88214675583811], [42.91556934421559, -78.8601415951723], [42.90368137519065, -78.86254485444964], [42.90187301402116, -78.85412979230752], [42.901860433728174, -78.86218070983887]]

# Nodes: 
# [There are no nodes defined] 

# Arcs/Routes: 
# [There are no arcs defined] 

# Text Annotations: 
annotDict = { 0: {'anchorPoint': [42.90544270046536, -78.8828867276186], 'text': 'AllenTown Buffalo(Expanded)', 'fontSize': 13, 'fontColor': 'brown'}}
myMap2 = myBoundingRegion2 
for i in annotDict: 
    myMap2 = vz.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 

myMap2=vz.addLeafletPolygon(
    mapObject=myMap2,
    mapFilename=None,
    mapBackground='CartoDB positron',
    mapBoundary=None,
    zoomStart=None,
    points=myBoundingRegion2,
    popupText=None,
    lineWeight=3,
    lineColor='purple',
    lineOpacity=0.8,
    lineStyle='solid',
    fillColor=None,
    fillOpacity=0.3,
)
myMap2
cmurray3 commented 8 months ago

Here is VeRoViz code for drawing 3 neighborhoods as shaded polygons, with a text label for each neighborhood:

myBoundingRegionFB = ???
myBoundingRegionMP = ???
myBoundingRegionAT = ???

# For each neighborhood, add a polygon
myMap = vrv.addLeafletPolygon(mapObject=None,    # Leave this as None on the first pass, then set = myMap for remainder 
                      mapFilename=None, 
                      mapBackground='CartoDB positron', 
                      mapBoundary=None, 
                      zoomStart=None, 
                      points=myBoundingRegionFB,    # Set to the appropriate list
                      popupText=None, 
                      lineWeight=3, 
                      lineColor='red', 
                      lineOpacity=0.8, 
                      lineStyle='solid', fillColor='red', fillOpacity=0.3)

# For each neighborhood, add a polygon
myMap = vrv.addLeafletPolygon(mapObject=myMap,    # set = myMap for remainder 
                      mapFilename=None, 
                      mapBackground='CartoDB positron', 
                      mapBoundary=None, 
                      zoomStart=None, 
                      points=myBoundingRegionMP,    # Set to the appropriate list
                      popupText=None, 
                      lineWeight=3, 
                      lineColor='red', 
                      lineOpacity=0.8, 
                      lineStyle='solid', fillColor='red', fillOpacity=0.3)

# For each neighborhood, add a polygon
myMap = vrv.addLeafletPolygon(mapObject=myMap,    # set = myMap for remainder 
                      mapFilename=None, 
                      mapBackground='CartoDB positron', 
                      mapBoundary=None, 
                      zoomStart=None, 
                      points=myBoundingRegionAT,    # Set to the appropriate list
                      popupText=None, 
                      lineWeight=3, 
                      lineColor='red', 
                      lineOpacity=0.8, 
                      lineStyle='solid', fillColor='red', fillOpacity=0.3)

# Text Annotations: 
annotDict = { 'FB': {'anchorPoint': [42.8989444395794, -78.86531352996826], 'text': 'Fruit Belt', 'fontSize': 29, 'fontColor': 'red'}}
              'AT': 

# myMap = None      # COMMENT THIS LINE OUT
for i in annotDict: 
    myMap = vrv.addLeafletText(mapObject=myMap, 
        anchorPoint=annotDict[i]['anchorPoint'], 
        text=annotDict[i]['text'], 
        fontSize=annotDict[i]['fontSize'], 
        fontColor=annotDict[i]['fontColor']) 

myMap
krysc0 commented 8 months ago

https://www.nytimes.com/interactive/2023/upshot/extremely-detailed-nyc-neighborhood-map.html

NYT NYC Neighborhood Interactive Map

cmurray3 commented 8 months ago

For future reference, the BNMC is located at [42.89575022809744, -78.86936091957004]

tericom commented 8 months ago

 # Fruit belt Inner bound # Bounding Region:
myBoundingRegion = [[42.90460933126765, -78.86810435237636], [42.89675532506902, -78.87068644346024], [42.896697686942915, -78.86828770834437], [42.897379516797464, -78.86803290896252], [42.89665052840332, -78.86483880024912], [42.89663349888188, -78.85375202484985], [42.89602436433593, -78.85373587712802], [42.90006222462684, -78.84431591402708], [42.90356672889447, -78.8441890739562]]

# Fruit Belt Outer Bound 

# Bounding Region:
myBoundingRegion = [[42.90516610275962, -78.86912790008773], [42.89571476094496, -78.87232842505027], [42.89495036647607, -78.86796626411079], [42.89485850483367, -78.85325958134622], [42.901133482594474, -78.83971535850358], [42.90442261477583, -78.83956518628534], [42.90515622474136, -78.86913514772188]]