Copilot commented on code in PR #2:
URL: https://github.com/apache/sedona-spatialbench/pull/2#discussion_r2311258261


##########
spatialbench/src/spider_defaults.rs:
##########
@@ -8,8 +8,8 @@ impl SpiderDefaults {
     const FULL_WORLD_AFFINE: [f64; 6] = [
         360.0, // Scale X to cover full longitude range (-180° to 180°)
         0.0, -180.0, // Offset X to start at -180° (west edge of map)
-        0.0, 180.0, // Scale Y to cover full latitude range (-90° to 90°)
-        -90.0, // Offset Y to start at -90° (south edge of map)
+        0.0, -160.0, // Scale Y to cover full latitude range (-80° to 80°)

Review Comment:
   The comment on line 11 is misleading. The value -160.0 is not the scale but 
part of the Y transformation matrix. The scale for Y should be -160.0 (the 
fourth element in the affine matrix), and the comment should reflect that this 
maps the unit square [0,1] to the latitude range [80°, -80°].
   ```suggestion
           0.0, -160.0, // Scale Y: maps unit square [0,1] to latitude range 
[80°, -80°]
   ```



##########
spatialbench/src/spider.rs:
##########
@@ -72,8 +72,12 @@ impl SpiderGenerator {
     }
 
     fn generate_uniform(&self, rng: &mut StdRng) -> Geometry {
-        let x = rand_unit(rng);
-        let y = rand_unit(rng);
+        let mut x = rand_unit(rng);
+        let mut y = rand_unit(rng);
+
+        // Hard code coordinate precision to 8 decimal places - milimeter 
level precision for WGS 84
+        x = (x * 100_000_000.0).round() / 100_000_000.0;
+        y = (y * 100_000_000.0).round() / 100_000_000.0;

Review Comment:
   The coordinate precision rounding logic is duplicated in three locations 
(generate_uniform, generate_normal, and generate_bit). Consider extracting this 
into a helper function to avoid code duplication and ensure consistency.



##########
spatialbench/src/spider.rs:
##########
@@ -154,7 +167,7 @@ impl SpiderGenerator {
         let a = (0.0, 0.0);
         let b = (1.0, 0.0);
         let c = (0.5, (3.0f64).sqrt() / 2.0);

Review Comment:
   The magic number 27 lacks explanation. Consider adding a comment explaining 
why this specific iteration count was chosen for the Sierpinski triangle 
generation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to