<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Even if I love QGIS, sometimes there is a better tool for certain
GIS jobs. In this case: <b>ogr2ogr</b>, which is a command-line
tool that's included in the QGIS distribution.</p>
<p>Do the following (I assume you want to make a shiny new
geopackage file instead of old fiddly shapefile):</p>
<ul>
<li>Create a directory in which to save the geopackage. Let's call
it : <b>c:\data</b></li>
<li>Create a text file with the following content:</li>
</ul>
<p><font size="-1" color="#ff0000"><tt><br>
</tt><tt>ogr2ogr -f GPKG c:\data\census.gpkg -nln census -nlt
PROMOTE_TO_MULTI
/vsizip//vsicurl/<a class="moz-txt-link-freetext" href="https://www2.census.gov/geo/tiger/TIGER2019/TRACT/tl_2019_01_tract.zip/tl_2019_01_tract.shp">https://www2.census.gov/geo/tiger/TIGER2019/TRACT/tl_2019_01_tract.zip/tl_2019_01_tract.shp</a></tt><tt><br>
</tt><tt>FOR %%G IN (02,04,05,06) DO (</tt><tt><br>
</tt><tt> ogr2ogr -f GPKG </tt></font><font size="-1"
color="#ff0000"><tt><font size="-1" color="#ff0000"><tt>c:\data\</tt></font>census.gpkg
-nln census -nlt PROMOTE_TO_MULTI -append -update
/vsizip//vsicurl/<a class="moz-txt-link-freetext" href="https://www2.census.gov/geo/tiger/TIGER2019/TRACT/tl_2019_%%G_tract.zip/tl_2019_%%G_tract.shp">https://www2.census.gov/geo/tiger/TIGER2019/TRACT/tl_2019_%%G_tract.zip/tl_2019_%%G_tract.shp</a></tt><tt><br>
</tt><tt>)</tt><tt><br>
</tt></font></p>
<ul>
<li>save it as: <b>c:\data\cc.cmd</b></li>
<li>start program "OSGeo4W Shell" it's located in same program
group as QGIS 3.12. It will start<b> </b>a dos command shell.</li>
<li>in the command shell: type: <b>call </b><b>c:\data\cc.cmd</b>
</li>
<li>Voila! the cmd file will create a geopackage
c:\data\census.gpkg that contains census tracts 01, 02, 04, 05,
06</li>
<li>You can extend the number of census tracts by extending the
linepart: <font size="-1" color="#ff0000"><tt>02,04,05,06</tt></font>
with (example) <font size="-1" color="#ff0000"><tt>02,04,05,06,08,09,10,11,12,13,15
</tt></font><font size="-1">etc.<br>
</font></li>
<li><font size="-1">This www page <b><a class="moz-txt-link-freetext" href="https://www2.census.gov/geo/tiger/TIGER2019/TRACT/">https://www2.census.gov/geo/tiger/TIGER2019/TRACT/</a>
</b>has a list of all available files. The available numbers
is between 01 and 78</font></li>
<li><font size="-1">The file names and www addresses can off
course be changed to other values.</font></li>
</ul>
<div class="moz-cite-prefix">Den 12-04-2020 kl. 20:07 skrev Mark
Fogarty:<br>
</div>
<blockquote type="cite"
cite="mid:014101d610f5$42463e60$c6d2bb20$@fogartyconsulting.com">
<pre class="moz-quote-pre" wrap="">hi. i'm new to the list and qgis, apologies if this has been asked. we're
working with the us census tract files available from census.gov here:
<a class="moz-txt-link-freetext" href="https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2019&layergroup">https://www.census.gov/cgi-bin/geo/shapefiles/index.php?year=2019&layergroup</a>
=Census+Tracts
they are published as 54 separate zip files, one per state. we would like to
combine them into a single dataset. i found a lot of pages on the web that
suggest using qgis for that purpose. they all start with
Click on the Vector menu, Data Management tools, Merge Shapefiles to
One...
i just installed qgis 3.12.1, but my vector / data management tools menu
doesn't have that option. has that tool been removed, or is there a plugin i
need to install or maybe a different version?
is that data already available in a combined format from somewhere, or is
there a better way to do this?
thanks
_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Med venlig hilsen / Kind regards
Bo Victor Thomsen
</pre>
</body>
</html>