Skip to content

Commit

Permalink
putting some style!
Browse files Browse the repository at this point in the history
  • Loading branch information
kauevestena committed Dec 17, 2023
1 parent 647a23e commit 614a66a
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 6 deletions.
51 changes: 51 additions & 0 deletions assets/addrs_centroids2.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.28.13-Firenze" styleCategories="Symbology">
<renderer-v2 type="singleSymbol" referencescale="-1" symbollevels="0" enableorderby="0" forceraster="0">
<symbols>
<symbol type="marker" frame_rate="10" force_rhr="0" is_animated="0" name="0" clip_to_extent="1" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer locked="0" pass="0" enabled="1" class="SimpleMarker">
<Option type="Map">
<Option type="QString" value="0" name="angle"/>
<Option type="QString" value="square" name="cap_style"/>
<Option type="QString" value="0,0,0,255" name="color"/>
<Option type="QString" value="1" name="horizontal_anchor_point"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="circle" name="name"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MapUnit" name="offset_unit"/>
<Option type="QString" value="255,255,255,255" name="outline_color"/>
<Option type="QString" value="solid" name="outline_style"/>
<Option type="QString" value="0.1" name="outline_width"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="outline_width_map_unit_scale"/>
<Option type="QString" value="MapUnit" name="outline_width_unit"/>
<Option type="QString" value="diameter" name="scale_method"/>
<Option type="QString" value="4" name="size"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="size_map_unit_scale"/>
<Option type="QString" value="MapUnit" name="size_unit"/>
<Option type="QString" value="1" name="vertical_anchor_point"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</symbols>
<rotation/>
<sizescale/>
</renderer-v2>
<blendMode>0</blendMode>
<featureBlendMode>0</featureBlendMode>
<layerGeometryType>0</layerGeometryType>
</qgis>
43 changes: 43 additions & 0 deletions assets/buildings.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.28.13-Firenze" styleCategories="Symbology">
<renderer-v2 type="singleSymbol" referencescale="-1" symbollevels="0" enableorderby="0" forceraster="0">
<symbols>
<symbol type="fill" frame_rate="10" force_rhr="0" is_animated="0" name="0" clip_to_extent="1" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer locked="0" pass="0" enabled="1" class="SimpleFill">
<Option type="Map">
<Option type="QString" value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale"/>
<Option type="QString" value="252,141,98,255" name="color"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="35,35,35,255" name="outline_color"/>
<Option type="QString" value="solid" name="outline_style"/>
<Option type="QString" value="0.2" name="outline_width"/>
<Option type="QString" value="MapUnit" name="outline_width_unit"/>
<Option type="QString" value="solid" name="style"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</symbols>
<rotation/>
<sizescale/>
</renderer-v2>
<blendMode>0</blendMode>
<featureBlendMode>0</featureBlendMode>
<layerGeometryType>2</layerGeometryType>
</qgis>
51 changes: 51 additions & 0 deletions assets/road_intersections.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.28.13-Firenze" styleCategories="Symbology">
<renderer-v2 type="singleSymbol" referencescale="-1" symbollevels="0" enableorderby="0" forceraster="0">
<symbols>
<symbol type="marker" frame_rate="10" force_rhr="0" is_animated="0" name="0" clip_to_extent="1" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer locked="0" pass="0" enabled="1" class="SimpleMarker">
<Option type="Map">
<Option type="QString" value="0" name="angle"/>
<Option type="QString" value="square" name="cap_style"/>
<Option type="QString" value="255,255,255,153" name="color"/>
<Option type="QString" value="1" name="horizontal_anchor_point"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="circle" name="name"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MapUnit" name="offset_unit"/>
<Option type="QString" value="35,35,35,255" name="outline_color"/>
<Option type="QString" value="solid" name="outline_style"/>
<Option type="QString" value="1" name="outline_width"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="outline_width_map_unit_scale"/>
<Option type="QString" value="MM" name="outline_width_unit"/>
<Option type="QString" value="diameter" name="scale_method"/>
<Option type="QString" value="4" name="size"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="size_map_unit_scale"/>
<Option type="QString" value="MapUnit" name="size_unit"/>
<Option type="QString" value="1" name="vertical_anchor_point"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</symbols>
<rotation/>
<sizescale/>
</renderer-v2>
<blendMode>0</blendMode>
<featureBlendMode>0</featureBlendMode>
<layerGeometryType>0</layerGeometryType>
</qgis>
25 changes: 19 additions & 6 deletions osm_sidewalkreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@

assets_path = os.path.join(basepath,'assets')

# this two are here because of the dependency structure
# in future they should be moved to generic_functions
def stylepath(filename):
return os.path.join(assets_path,filename)

def apply_style(layer,filename):
layer.loadNamedStyle(stylepath(filename))

basic_folderpathlist = [temps_path,reports_path,assets_path]
for folderpath in basic_folderpathlist:
Expand Down Expand Up @@ -681,6 +688,8 @@ def data_clean(self):
create_fill_id_field(self.splitted_lines)

# adding layers to canvas:
apply_style(self.splitted_lines,road_intersections_stylefilename)

self.add_layer_canvas(self.filtered_intersection_points)
self.add_layer_canvas(self.splitted_lines)

Expand Down Expand Up @@ -1792,9 +1801,10 @@ def draw_sidewalks(self):


# styling the sidewalks layer
self.sidewalk_stylefile_path = os.path.join(assets_path,sidewalks_stylefilename)
# self.sidewalk_stylefile_path = os.path.join(assets_path,sidewalks_stylefilename)

self.whole_sidewalks.loadNamedStyle(self.sidewalk_stylefile_path)
# self.whole_sidewalks.loadNamedStyle(self.sidewalk_stylefile_path)
apply_style(self.whole_sidewalks,sidewalks_stylefilename)

# adding layers to canvas
self.add_layer_canvas(self.exclusion_zones)
Expand Down Expand Up @@ -2232,9 +2242,10 @@ def get_input_feature(self):
self.iface.mapCanvas().refresh()

# setting a default style for input polygons:
inputpolygons_stylelayerpath = os.path.join(assets_path,inputpolygons_stylefilename)
# inputpolygons_stylelayerpath = os.path.join(assets_path,inputpolygons_stylefilename)

self.input_layer.loadNamedStyle(inputpolygons_stylelayerpath)
# self.input_layer.loadNamedStyle(inputpolygons_stylelayerpath)
apply_style(self.input_layer,inputpolygons_stylefilename)

# enabling itens for next step
self.dlg.datafetch.setEnabled(True)
Expand Down Expand Up @@ -2390,6 +2401,7 @@ def call_get_osm_data(self):
self.dlg.datafetch_progressbar.setValue(55)

if draw_buildings:
apply_style(self.reproj_buildings,buildings_stylefilename)
self.add_layer_canvas(self.reproj_buildings)


Expand Down Expand Up @@ -2459,9 +2471,10 @@ def call_get_osm_data(self):

self.POIs_for_splitting_layer.setCrs(self.custom_localTM_crs)

pois_stylepath = os.path.join(assets_path,'addrs_centroids.qml')
# pois_stylepath = os.path.join(assets_path,'addrs_centroids2.qml')

self.POIs_for_splitting_layer.loadNamedStyle(pois_stylepath)
# self.POIs_for_splitting_layer.loadNamedStyle(pois_stylepath)
apply_style(self.POIs_for_splitting_layer,splitting_pois_stylefilename)

self.add_layer_canvas(self.POIs_for_splitting_layer)

Expand Down
3 changes: 3 additions & 0 deletions parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
crossings_stylefilename = 'crossings.qml'
kerbs_stylefilename = 'kerbs.qml'
exclusion_stylefilename = 'exclusion_zones.qml'
splitting_pois_stylefilename = 'addrs_centroids2.qml'
buildings_stylefilename = 'buildings.qml'
road_intersections_stylefilename = 'road_intersections.qml'



Expand Down

0 comments on commit 614a66a

Please sign in to comment.