[Qgis-user] Polygon colours in existing shape files.
Hello, I have a number of files that are full of filled polygons, which are available as .shp or .tab files. Most of these files represent geological data, so the colours of the polygons are an important part of visually identifying the data. When I was using these in Mapinfo (and from what I saw in Arc) they would come up with the predefined colours consistently. When I open these up in Qgis, it does not appear to honour these colours (regardless of whether I open the shp or tab file). Is there a way to get Qgis to use these colours? If there isn't, is there a quicker way of getting these colours back to what I'm expecting? At the moment the best I can see is to group them by the code fields and then redo do hundreds of code colours. -ramon.___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Polygon colours in existing shape files.
Hi Ramon, I guess you'll have to redo the layer style in QGIS. Whatever format Mapinfo uses to store style information (the is no style information contained in any of the shapefile files), QGIS can't interpret it. Depending on the Mapinfo file format, you could propably write a converter to QGIS style files. Best wishes, Anita Original-Nachricht Datum: Fri, 8 Oct 2010 17:34:57 +0800 Von: Ramon Andinach cust...@westnet.com.au An: qgis-user@lists.osgeo.org Betreff: [Qgis-user] Polygon colours in existing shape files. Hello, I have a number of files that are full of filled polygons, which are available as .shp or .tab files. Most of these files represent geological data, so the colours of the polygons are an important part of visually identifying the data. When I was using these in Mapinfo (and from what I saw in Arc) they would come up with the predefined colours consistently. When I open these up in Qgis, it does not appear to honour these colours (regardless of whether I open the shp or tab file). Is there a way to get Qgis to use these colours? If there isn't, is there a quicker way of getting these colours back to what I'm expecting? At the moment the best I can see is to group them by the code fields and then redo do hundreds of code colours. -ramon.___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Polygon colours in existing shape files.
Anita Graser claviota: Whatever format Mapinfo uses to store style information Here is an example of a polygon with (horrible) graphical attributes, from a .mif file: Region 1 27 149046.45 52513.21 149238.51 52320.02 149398.07 52126.69 149623.94 52014.52 149816.52 51853.69 149913.33 51805.61 150072.11 51563.76 150134.85 51418.51 150180.57 51224.64 150259.83 51095.63 150435.38 50886.19 150321.29 50869.5 150191.18 50868.9 150077.35 50868.37 149865.17 50818.88 149571.94 50785.18 149279.47 50800 149133.63 50831.67 149005.07 50928.11 148829.25 51121.38 148831.56 51266.94 148786.62 51509.32 148756.15 51638.56 148807.75 51816.69 148826.84 51994.68 148877.93 52140.46 149046.45 52513.21 Pen (1,2,0) Brush (2,16777215,16777215) Center 149595.77 51649.2 As you can see, this is totally different from the normal GIS approach, where graphical appearance of a geographical item depends on its data. This mapinfo way is absolutely horrible, it regularly leads to some catastrophes... especially in the geological world... ;) (the is no style information contained in any of the shapefile files), QGIS can't interpret it. Depending on the Mapinfo file format, you could propably write a converter to QGIS style files. For this, you need to read the graphical attributes from the .mif file (not the original .tab, .dat, .id, .ind), and put the graphical attributes as normal attributes in the .mid file. And then only, do a style. A faster approach would be to first use mapinfo. Some extensions (like discover) allow to do select by graphical appearance or something similar (if I remember well: I have no more mapinfo around (fortunately!)), and then you can, in the mapbasic window (which should always be opened somewhere), type: UPDATE selection SET geol_unit = Burdigalian limestone You change the graphical selection using the same extension, you now pick up the green hashed polygons for instance, and then type: UPDATE selection SET geol_unit = Birimian B1 greywacke And so on. This way, you inform your attributes table. Parenthesis: ( This is something very neat and efficient in mapinfo (yes, it has some qualities!): this little mapbasic window allows you to run plenty of commands (sql or map making or graph plotting or... ), and the selection always corresponds to whatever data is actually selected. Repeating mapbasic instructions while playing with the selection is extremely efficient. Idea: why not try to implement this kind of approach in qgis? ) Once you're done, you can open your file again in qgis (or any other normal GIS package) and do a thematic analysis (in mapinfo terms) on your attributes. And you pick up the right colors, patterns, etc. for each formation. Hope it helps... A+ Pierre -- Pierre Chevalier Géologue EI Mesté Duran 32100 Condom Tél+fax :09 75 27 45 62 05 62 28 06 83 06 37 80 33 64 Émail : pierrechevaliergeolCHEZfree.fr icq# : 10432285 skype : pierre.chevalier1967 http://pierremariechevalier.free.fr/pierre_chevalier_geologue ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Polygon colours in existing shape files.
Hi Ramon, What you describe is data-defined styling - taking the symbology options from a db field. In QGIS you can use this for label settings, like font-family, font-color, position, styles, etc. - unfortunately this is not available for the simpler task of styling polygons or lines. It would be very useful to have this data-defined styling also for general symbology options. Also the stroke-width would be a natural candidate for data-defined styling. Sorry for not being of better help. Andreas On Fri, October 8, 2010 11:34 am, Ramon Andinach wrote: Hello, I have a number of files that are full of filled polygons, which are available as .shp or .tab files. Most of these files represent geological data, so the colours of the polygons are an important part of visually identifying the data. When I was using these in Mapinfo (and from what I saw in Arc) they would come up with the predefined colours consistently. When I open these up in Qgis, it does not appear to honour these colours (regardless of whether I open the shp or tab file). Is there a way to get Qgis to use these colours? If there isn't, is there a quicker way of getting these colours back to what I'm expecting? At the moment the best I can see is to group them by the code fields and then redo do hundreds of code colours. -ramon.___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user -- Andreas Neumann http://www.carto.net/neumann/ http://www.svgopen.org/ ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Polygon colours in existing shape files
On MapInfo side: There are MapBasic functions that read object style values. You can use them to populate the attribute table with the styles. This should then be possible without mif/mid export. On QGis side: make use of the style values already in attribute table, by translating them into qgis styles. I don't know yet how to automate it :) Maybe creating an external dictionary table mapping MI styles onto qgis styles would be helpful. In case your polygons have an attribute that differentiate the style, you can just create qgis styles from the scratch in a table or text file and use (python?) script in qgis to apply them to a layer. If not, Select objects by style function is a part of MapCAD toolset in MIPro you can use to differentiate polygons. Personally, I find storing styles inside of tab file the MIPro advantage. In qgis you always get a random style unless you save a project. Command line (MapBasic window equivalent) in QGIS would be a great feature. Bests, KubaZ I have a number of files that are full of filled polygons, which are available as .shp or .tab files. Most of these files represent geological data, so the colours of the polygons are an important part of visually identifying the data. When I was using these in Mapinfo (and from what I saw in Arc) they would come up with the predefined colours consistently. When I open these up in Qgis, it does not appear to honour these colours (regardless of whether I open the shp or tab file). Is there a way to get Qgis to use these colours? If there isn't, is there a quicker way of getting these colours back to what I'm expecting? At the moment the best I can see is to group them by the code fields and then redo do hundreds of code colours. -ramon. -- Grasz iwygrywasz!!! Bilet na final Ligi Mistrzow! http://linkint.pl/f282c ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Polygon colours in existing shape files
In qgis you always get a random style unless you save a project. You can also set a default style for a layer (button Save as Default). It will be applied even if you load the layer into a different/new project. Best wishes, Anita -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Polygon colours in existing shape files
There is potential for automatically styling data from MapInfo data sets, I don't know how feasible it is or whether there is a large enough MapInfo contingent that would be interested in funding the effort if it is possible. In a MapServer application, one can specify that MapServer should use the symbology/styling info stored in the .TAB file. This functionality depends on the GDAL/OGR driver, so I don't know how much of this support is in OGR code and how much is the MapServer code. http://mapserver.org/input/vector/mapinfo.html Also, assuming license compatibility: http://mapserver.org/copyright.html David. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user