0

I am newbie to QGIS and following the tutorial from this website to learn how to use QGIS: https://csdigeolab.gov.hk/en/resources/videos/gis-et-ep2 (Sorry but the video only provides a Chinese version)

I have learnt how to add the XYZ tiles connection of the Hong Kong tomo map and labels. However, I was facing difficulty when it came to learning how to add GML and CSV data to the map. The data is shifting to Africa instead of Hong Kong.

I have tried to change the project's CRS from WGS84(EPSG:4326) to Hong Kong 1980 Grid system (EPSG:2326) (since it is usual to use EPSG:2326 in HK) and change the data layer to EPSG:2326 as well but nothing has helped.

Screenshot of the data is shifting to Africa: enter image description here

The GML data I downloaded is from this website: https://static.csdi.gov.hk/csdi-webpage/download/0d8a2101cfd5560da08d5261b3c6003e/gml

But I think it is unlikely to be the wrong coordinate of the data. Something I did was wrong to cause this issue.

For information, I am using QGIS 3.34.7 LTR.

4
  • 1
    Welcome to GIS SE. As a new user, please take the Tour. This is another example of our most frequent question (QGIS flavor). The difficulty is from telling the software the coordinate reference is what you want it to be, instead of asking it to change the data. Most GIS packages use the coordinate reference definition to render features correctly in the canvas. If you tell the software WGS84 degree data is actually Web Mercator, it will plot the data within 180 meters of the origin of that PCS. You need to Project the data, not Define the projection.
    – Vince
    Commented Jun 19 at 11:23
  • @Vince Thank you for your reply. I have read some websites which teach me how to define the projection instead of projecting the data, like this: link May I ask you to give me the tutorial link to how to project the data or is it a keyword to let me find the instruction to project the data?
    – Light
    Commented Jun 20 at 2:46
  • 1
    99 and 997 thousandths percent of the time, defining the projection is the WRONG thing to do. This is the root of trouble that occurs over and over, in many software platform flavors. Projection metadata is the responsibility of the data provider, not the data consumer. On-the-fly reprojection should handle the rest.
    – Vince
    Commented Jun 20 at 3:06
  • @Vince Sorry but I am being silly and still have no clue how to reproject the layer to the right one. I have even tried to use the 'Reproject Layer' and output it to 'EPSG:2326' from 'EPSG:2326' or 'EPSG:4326' from 'EPSG:2326'. Of course, it has no effect. If nmtoken had not told me he ran it successfully, I would have even suspected the file had a problem.
    – Light
    Commented Jun 20 at 9:35

1 Answer 1

2

I'm not sure what you've done wrong but for me the GML is correctly projected (is in urn:ogc:def:crs:EPSG::2326) and displays in the correct location in QGIS >>

Hong Kong data

Using QGIS 3.34.

9
  • May I ask what is the QGIS version you have used? I am kind of feeling frustrated since I spent a day looking for a solution (it seems to be simple by dragging the GML file to QGIS in the videos) but the layer is still located in Africa.
    – Light
    Commented Jun 20 at 7:19
  • I have read some article like link. It said that the x,y should be swap (but the plugin Swap XY is no longer available) or I should disable the on-the-fly CRS transformation and save the layer as another CRS (the original poster said that he solves the problem by doing so). However, turning off on-the-fly CRS is no longer available in QGIS 3...
    – Light
    Commented Jun 20 at 7:21
  • 1
    I had a try with QGIS 3.37. I opened the OpenSteetmap XYZ layer on the bottom and drag-n-dropped the GML file into the project. No problem at all, the polygons appear in Hong Kong.
    – user30184
    Commented Jun 20 at 10:28
  • Older versions of QGIS may not be correctly reprojecting requiring the axes reordering, EPSG:2326 is Northing/Easting, but later versions get it correct.
    – nmtoken
    Commented Jun 20 at 10:46
  • 1
    What if you try, open QGIS, change settings > options > CRS and transforms > CRS handling > CRS for Projects > Use CRS from first layer added. Then drag the gml to QGIS. Map Canvas should change to EPSG:2326
    – nmtoken
    Commented Jun 21 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.