[Qgis-us-user] Converting from Shapefile to JSON format with geometry features.
Michele M Tobias
mmtobias at ucdavis.edu
Fri Jul 23 12:39:04 PDT 2021
You can script the whole workflow to do each step in succession if you'd like or the model builder might also be useful if you'd like a graphical tool. There's good information about this in the QGIS user's manual here: https://docs.qgis.org/3.16/en/docs/user_manual/processing/index.html
Michele Tobias, PhD
Geospatial Data Specialist
DataLab: Data Science & Informatics
Data & Digital Scholarship
UC Davis Library
370 Shields Library
mmtobias at ucdavis.edu
Pronouns: she, her, hers
From: Qgis-us-user <qgis-us-user-bounces at lists.osgeo.org> On Behalf Of Keith Jenkins
Sent: Friday, July 23, 2021 12:30 PM
To: Carl Reinemann <creinemann at gmail.com>
Cc: qgis-us-user at lists.osgeo.org
Subject: Re: [Qgis-us-user] Converting from Shapefile to JSON format with geometry features.
You can use ogr2ogr on the command line like this:
ogr2ogr -f "GeoJSON" -dialect SQLite -sql "select ST_Buffer(geometry,
0.01) from inputfile" output.geojson inputfile.shp
substituting your filename for "inputfile" in both places.
QGIS uses OGR behind the scenes to handle most vector datasets, so it should already be on your computer if installed QGIS. For more details about OGR, see https://gdal.org/programs/ogr2ogr.html
On Fri, Jul 23, 2021 at 2:37 PM Carl Reinemann <creinemann at gmail.com> wrote:
> I am Brand new to QGIS. I have a question on the conversion of a shapefile (.shp) to a geojson format. I am using data produced by NOAA,NASA to map out on satellite imagery, current fire hotspots onto satellite imagery I receive and process at home.
> The data I download is from here
> https://firms.modaps.eosdis.nasa.gov/active_fire/ (I use the shp files)
> I have a small script that downloads it every 12 hours.
> I then use QGIS this way, to convert it into the type I need to apply it to my imagery.
> This is the current way I process it with QGIS 3.16.8
> 1. Add a vector layer and open the .shp file I want to convert.
> 2. Goto Vector-
> -Geoprocessing Tools
> 3. I then change the distance to .01
> 4. then I run the Buffer (this is to create the geometry I need,
> rather than point) 5. I then export the Buffered file "Save Features as"
> --selecting GEOJSON
> -saving it as a file.
> This works and provides me the data in the format I need.
> My questions this- Can this be done via a command line?
> I wish to use my PC to automate the process so that I can have it run in a batch file after the data download.
> I am open to other methods as well.
> An example of the imagery with the data applied is here.
> Qgis-us-user mailing list
> Qgis-us-user at lists.osgeo.org
Qgis-us-user mailing list
Qgis-us-user at lists.osgeo.org
More information about the Qgis-us-user