Sorry to say I was failed to recreate this issue as we don’t have the data, but I found some hints here. Maybe you can refer to MapPrinterLayer not printing to scale to see if it’s helped.
NOTE: could you please tell me what tools you using to measure the size?
I have loaded the example “ScaleBarTest” and checked the printing…
I have changed the “SetScale” Sub to
Dim oExtent As RectangleShape = ExtentHelper.ZoomToScale(10000, moPageLayoutMap.MapExtent, moPageLayoutMap.MapUnit, dWidth, dHeight)
So ScaleBar should display correct Width for 500 Meter at printing area.
When printing to PDF I get a very bad result: The ScaleBar Displays 500m at a scale of 1:10000.
But the width is 57.66 mm (measured on PDF with Pdf-Tools).
Please have a look at my attachement. 3.pdf (85.5 KB)
I’m expecting an exact result. 500m must be 50mm at 1:10000 Scale.
Sorry for the delay. I’ve just come back from holiday. It seems that there’s a syntax error for SQL-script showing as below. (NOTE: I use pgAdmin client and postgreSQL 9.5)
Hi Don,
I used the following command to enter the test geometry:
INSERT INTO atest(
the_geom)
VALUES (geomfromtext(‘POLYGON((480400 5967500,481400 5967500,481400 5968500,480400 5968500,480400 5967500))’,25832));
To create the table:
CREATE TABLE atest
(
gid serial NOT NULL,
fc character varying(50),
uri character varying(255),
rotation double precision DEFAULT 0,
txtrotation double precision DEFAULT 0,
txtdx double precision DEFAULT 0,
txtdy double precision DEFAULT 0,
fid integer DEFAULT 0,
editor integer DEFAULT 0,
constructor integer DEFAULT 0,
created date DEFAULT (‘now’::text)::date,
lastupdate date DEFAULT (‘now’::text)::date,
mandant integer DEFAULT 0,
parentinfo character varying(255),
parentformel integer DEFAULT 0,
parent character varying(50),
text01 character varying(50),
text02 character varying(50),
text03 character varying(50),
the_geom geometry,
CONSTRAINT atest_pk PRIMARY KEY (gid),
CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 25832)
)
WITH (
OIDS=FALSE
);
ALTER TABLE atest OWNER TO postgres;
– Index: atest_fid_idx
– DROP INDEX atest_fid_idx;
CREATE INDEX atest_fid_idx
ON atest
USING btree
(fid);
– Index: atest_geom_idx
– DROP INDEX atest_geom_idx;
CREATE INDEX atest_geom_idx
ON atest
USING gist
(the_geom);
Sorry for the delay. This time I create the table successfully, but failed to insert the data into the database as it returns an error “function geomfromtext(unknown, integer) does not exist”. I do some research but don’t find out the solution for this. Please forgive me for being a beginner on postgresql.
It’s still in progress as I don’t find the function geomfromtext. I see the script and there is only one record in atest table. Is it possible for you to convert the record into WKT, so I can use it to recreate the issue?
Thanks for your shape file, because our forum issue we hadn’t get the update of this post. Peter is busy and cannot work on support team near future, so I will look into your problem and reply you after get any progress.
It looks the other guy who met the same issue before, I will try to find the topic also to see whether that’s helpful.
I still cannot update about this issue, but I will ask our developer about the status again and see whether we can get more time on this problem.
It’s hard to make sure where is the problem, because that maybe because projection conversion, scale calculation, printing convert or scaleline calculation incorrect.
And the new release takes many sources, our developer cannot get enough time on support these days, so the process looks not good.
thanks for your information.
But the square is 1000m x 1000m, when using epsg:=25832.
So you must set projection when reading the layer from shape-file.
Maybe that’s the/one error when printing to paper and scaling is going wrong.
I checked that, button what you have done is to define a square with 1000 x 1000m using an inMemoryFeaturLayer.
Please use the shape file. When using the shape file I’m getting a length of 203,20 mm. That’s wrong!
I like to get an exact length by setting a map scale (for example 1:50000).