[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AWIPS #DWE-831183]: Maps Database Reference Page



So you should be getting all highways on your request, but from there you can 
specify what you would like displayed (ex. just State highways or Interstates) 
or if you know the name of the specific highway you are wanting to plot.

In our maps example here: 
https://unidata.github.io/python-awips/examples/generated/Map_Resources_and_Topography.html

We can change section 6 to the following code below where we are setting a few 
parameters that we are requesting, and then we are plotting just the State 
highways ("S") in orange and Interstates ("I") in blue:

(please note that sometimes the formatting of the code gets messed up when sent 
via our support email)

# Define the request for the interstate query
request = DataAccessLayer.newDataRequest('maps', envelope=envelope)
request.addIdentifier('table', 'mapdata.highway')
request.addIdentifier('geomField', 'the_geom')
request.setParameters('name','hwy_type')
highways = DataAccessLayer.getGeometryData(request)

# Plot highways
for ob in highways:
    if(ob.getString('hwy_type') == "S"):
        obcount=obcount+1
        shape_feature = ShapelyFeature(ob.getGeometry(),ccrs.PlateCarree(), 
                            facecolor='none', linestyle="-",edgecolor='orange')
        ax.add_feature(shape_feature)
    if(ob.getString('hwy_type') == "I"):
        obcount=obcount+1
        shape_feature = ShapelyFeature(ob.getGeometry(),ccrs.PlateCarree(), 
                            facecolor='none', linestyle="-",edgecolor='blue')
        ax.add_feature(shape_feature)
print("Using " + str(obcount) + " interstate MultiLineStrings")
fig


Thanks,

Tiffany Meyer
AWIPS Lead Software Engineer
NSF Unidata

If you're interested, please feel free to fill out a survey about the support 
you receive:  
https://docs.google.com/forms/d/e/1FAIpQLSeDIkdk8qUMgq8ZdM4jhP-ubJPUOr-mJMQgxInwoAWoV5QcOw/viewform

Ticket Details
===================
Ticket ID: DWE-831183
Department: Support AWIPS
Priority: Normal
Status: Open
===================
NOTE: All email exchanges with NSF Unidata User Support are recorded in the 
Unidata inquiry tracking system and then made publicly available through the 
web.  If you do not want to have your interactions made available in this way, 
you must let us know in each email you send to us.